Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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 SubBut 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.

![]() |
![]() |
![]() |

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