What is the code that links vb 6.0 to Ms Access and how to go about it?

135 pts.
Tags:
Access Database
Microsoft Access
VB Code
Visual Basic 6
What is the code that links vb 6.0 to Ms Access and how to go about it?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Some snippets here….
Also a <a href=”http://www.vbexplorer.com/VBExplorer/vb_feature/june2000/Database_Beginner_ADO_DAO.asp”>good help</a>
From Mgi: <pre>

Public conMyDB As New ADODB.Connection
»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»

Private Sub Form_Load()
Dim rsTemp As New ADODB.Recordset

If conMyDB.State = adStateClosed Then

Call ConnectToMyDB
End If
rsTemp.Open “SELECT SomeFields FROM SomeTable”, conMyDB, adOpenDynamic, adLockOptimistic
End Sub

Public Sub ConnectToMyDB()
If conMyDB.State <> adStateOpen Then

conMyDB.Open “Driver={Microsoft Access Driver (*.mdb)};” & _
“Dbq=SomeMappedDrive:\MyDB Projects”;Uid=admin;Pwd=”
End If</pre>

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • mgj
    Did I not use the interface correctly? Not sure how my answer is shown as EmNichs
    320 pointsBadges:
    report
  • MelanieYarbrough
    Hi Mgi, Whenever the Answer Wiki is modified, it shows the avatar of the last person to make modifications. Feel free to sign future answers with your name or include a divider to better differentiate between answers/answerers. Thanks so much! Melanie
    6,345 pointsBadges:
    report
  • mgj
    »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» Now I see; Thanks:) MGJ »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
    320 pointsBadges:
    report
  • nyaga
    Have tried the code but keeps popping an error
    135 pointsBadges:
    report
  • carlosdl
    Nyaga, If you are getting errors, you should post the complete error messages. Without that, I don't think you are going to get accurate help.
    67,985 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following