View Poll Results: Easiest way to connect to a MS Access DB

Voters
7. You may not vote on this poll
  • ODBC

    0 0%
  • ADODB

    2 28.57%
  • ADO

    5 71.43%
Results 1 to 6 of 6

Thread: [RESOLVED] ADODB/MS Access 97 conflicts

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2005
    Posts
    200

    Resolved [RESOLVED] ADODB/MS Access 97 conflicts

    ok I'm using an ADODB connection to connect VB6 to a MS Access 97 database. Now I converted the database from a MS Access 2003 database, and because of this I can not change the data in the database. My question is: can somone point me on how to set up an ODBC connection with VB to connect to a MS Access 2003 database so that I can manipulate the data?
    VB Code:
    1. [FONT=Lucida Console]'Create a new connection --
    2.         Set adoConnection = New ADODB.Connection
    3.        
    4.         'Create a new recordset --
    5.         Set adoRecordset = New ADODB.Recordset
    6.        
    7.         'Build our connection string to use when we open the connection --
    8.         connectString = "Provider=Microsoft.Jet.OLEDB.3.51;" _
    9.                          & "Data Source=C:\Documents and Settings\P6B0438\Desktop\CycleCount.mdb"
    10.        
    11.         adoConnection.Open connectString
    12.        
    13.         adoRecordset.Open "SECURITY", adoConnection
    14.         Do Until adoRecordset.EOF
    15.             If (adoRecordset!UserName = txtUserName.Text) Then
    16.                 Dim str As String
    17.                 str = txtOldPassword.Text
    18.                 If (adoRecordset!Password = txtOldPassword.Text) Then
    19.                      [B]'this line does not work
    20.                      adoRecordset!Password = txtNewPassword1.Text[/B]
    21.                 End If
    22.                 MsgBox ("The password should have been changed from " & str & " to " & adoRecordset!Password)
    23.                
    24.             End If
    25.             adoRecordset.MoveNext
    26.         Loop[/FONT]




    Edit: Added [vbcode][/vbcode] tags for clairty. - Hack
    Last edited by Hack; Sep 14th, 2005 at 01:44 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width