Opening a connection with ADO to a MS Access 97 .mdb file 
Author Message
 Opening a connection with ADO to a MS Access 97 .mdb file

Can anyone tell me what i`m doing wrong .. I can`t seem to get or work
out the propper connection method ...

My code is listed bellow but returns the error

`Can`t start your application: The workgroup information file is
missing or opened exclusivly by another users ..`

Any help would be of interest .. especialy a working code example and
database.

Private Sub Command1_Click()

Dim conn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
' Open Connection

conn.Open "provider=Microsoft.Jet.OLEDB.3.51;data
source=c:\temp\t2supprt.mdb;User ID=Admin;Password=xxxx"
' SQL ?
Set cmd.ActiveConnection = conn
cmd.CommandText = "SELECT * from tblClient"
' Cursor Location
' rs.CursorLocation = tblClient
rs.Open cmd, , adOpenStatic, adLockBatchOptimistic
' Step 4
rs.Sort = "SearchName"
rs.Filter = "Telephone LIKE '0171*'"
rs.MoveFirst
Do While Not rs.EOF
    Debug.Print "Name: " & rs!SearchName & "Phone: " & rs!Telephone &
vbCr
    rs.MoveNext
Loop
' Step 5

conn.BeginTrans

'Step 6, part A
On Error GoTo ConflictHandler
rs.UpdateBatch
On Error GoTo 0

conn.CommitTrans
Exit Sub

'Step 6, part B
ConflictHandler:
rs.Filter = adFilterConflictingRecords
rs.MoveFirst
Do While Not rs.EOF
    Debug.Print "Conflict: Name: " & rs!SearchName & "Phone: " &
rs!Telephone & vbCr
    rs.MoveNext
Loop
conn.Rollback
Resume Next
End Sub



Sun, 11 Mar 2001 03:00:00 GMT  
 Opening a connection with ADO to a MS Access 97 .mdb file

Quote:
>Can anyone tell me what i`m doing wrong .. I can`t seem to get or work
>out the propper connection method ...
>`Can`t start your application: The workgroup information file is
>missing or opened exclusivly by another users ..`

You are specifying Jet security information (user id and password) but

you are not pointing to the Jet system database that controls the
security information. Is the database actually secured? here's an
example of creating a connection on a secured database:

  Dim strConn As String
  Dim cnn As ADODB.Connection
  Dim rst As ADODB.Recordset

  strConn = "User ID=xxx;Password=yyy;" & _
    "Data Source=g:\vbfms\taagent32\code\taagnt32.mdb;" & _
    "Provider=Microsoft.Jet.OLEDB.3.51;" & _
    "Jet OLEDB:System database=g:\vbfms\taagent32\code\taasys32.mdw;"

  Set cnn = New ADODB.Connection
  cnn.ConnectionString = strConn
  cnn.Open

  Set rst = New ADODB.Recordset
  rst.ActiveConnection = cnn
  rst.Open "tblSettings"
  Do Until rst.EOF
    Debug.Print rst(0)
    rst.MoveNext
  Loop

-- Jim Ferguson, FMS
   http://www.fmsinc.com



Mon, 12 Mar 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Opening Access 97 mdb file with Windows 2000

2. Access 97 connection with MS Word 97

3. Specifiying a Workgroup File When Using ADO to Open an Access .mdb file (OLEDB)

4. TransferDatabase method from Access 95 mdb to Access 97 mdb

5. Error Connection to Access 97 MDB

6. Accessing Usernames in Ms Access 97 Using ADO

7. Cannot Open Access 97 Database without extension *.mdb with CR8.5

8. Open Connection to Access 97 problems

9. opening MS word from access 97

10. Open a secured MS Access 97 db in VBScript

11. HELP : Access 97 doesn't recognize my MDB file

12. ADO Deployment problem with MS Access 97

 

 
Powered by phpBB® Forum Software