Computing.Net > Forums > Programming > How to connect VB6 with Access

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to connect VB6 with Access

Reply to Message Icon

Name: Apple
Date: December 8, 2003 at 20:44:56 Pacific
OS: win98
CPU/Ram: 166
Comment:

I want a help regarding to connect my small database application with Access. Yes iam using VB6 ADO and access in back end. I use a module this code.

Public cn As New ADODB.Connection

Private Sub Form_Unload(Cancel As Integer)
cn.Close
Set cn = Nothing
End Sub


Public Sub MAIN()
Set cn = New ADODB.Connection
cn.CursorLocation = adUseClient
cn.Open "dsn=dsn_School"
End Sub

But when i run it VB6 shows me an error "Operation Cancled" at cn.Open "dsn=dsn_School" line.
In Project properties i choose Startup Ptoject i.e Main
but still there is an message "Operation Cancled".

In ODBC i choose System DSN & write the DSN Name i.e "dsn_school " Microsoft Access Driver & click ok.
Now i do,t know how to tell vb that where is the path of my Access file.

If i Click the select button under configur button of DSN & write the path where the file of Access is located then vb does,t give any meaage .It load the form & at the same moment it unload the form without doing anything !
I do,t know how to solve it.If any body can solve my big problem i shall be so much thankful to him.
Thnaks.



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: How to connect VB6 with Access

connect VB6.0 with SQL 7.0 www.computing.net/answers/programming/connect-vb60-with-sql-70/5691.html

How to use multithreads with C/C++ www.computing.net/answers/programming/how-to-use-multithreads-with-cc/6229.html

How to connect VB6 database file wi www.computing.net/answers/programming/how-to-connect-vb6-database-file-wi/8780.html