Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to access Access 2000 from VB 6
Message
General information
Forum:
Visual Basic
Category:
Access
Miscellaneous
Thread ID:
00983853
Message ID:
00985518
Views:
36
Allan,

Thank you very much for your help. I will pass the code to my friend.

>Here is some VB6 code that creates a connection object and a connection to an Access database that does not lock the database:
>
>Dim rsData As New ADODB.Recordset
>Dim objConn As New ADODB.Connection
>Dim strConn As String
>Dim strSQL As String
>
>    'create connection string
>    strConn = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & App.Path & "/T5Database.mdb;USER ID=;PASSWORD=;"
>
>    'open connection to Access Database
>    With objConn
>        .ConnectionString = strConn
>        .CursorLocation = adUseClient
>        .CommandTimeout = 180  '3 minutes timeout
>        .Mode = adModeReadWrite
>        .Open strConn
>    End With
>
>    strSQL = "Select * from T5Data"
>
>    With rsData
>        .ActiveConnection = objConn
>        .CursorType = adOpenStatic
>        .CursorLocation = adUseClient
>        .LockType = adLockOptimistic
>        .Open strSQL
>    End With
>
>
>
>>A friend of mine asked me the following question.
>>
>>She has Access 2000. When she opens tables/database directly from the Access environment, not a problem; more than one person can access the database at the same time. But when she opens a table/database from a form created in VB 6, no one else can access the database. The question is, what command in VB 6 should be issued in code when opening Access 2000 database so that it would be opened in a shared mode.
>>
>>I would appreciate any suggestions.
>>
>>Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform