Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unrecognised Database Format
Message
 
To
10/07/2000 02:34:15
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00388210
Message ID:
00390384
Views:
8
>Hi Eric,
>
> Could u please check for me this preview coding. I can update the record but I can't preview the record. Before I use the same coding for Access 97 0LEDB.3.51.
>
>Dim BookRec As New ADODB.Recordset
>Dim BookCon As New ADODB.Connection
>
>Private Sub Form_Load()
> BookCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Book\Book.mdb;Persist Security Info=False"
> BookRec.ActiveConnection = BookCon.ConnectionString
> BookRec.Open "Select * from Book", , adOpenStatic, adLockReadOnly
> Set DataGrid1.DataSource = BookRec
>End Sub
>
>Thank you.

Change your code this way:
Private Sub Form_Load()
BookCon.CursorLocation = adUseClient
BookCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Book\Book.mdb;Persist Security Info=False"
BookCon.Open
BookRec.Open "Select * from Book", BookCon, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = BookRec
End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform