|
-
May 30th, 2006, 09:41 AM
#1
Thread Starter
Frenzied Member
compile error
Dim cn As ADODB.Connection
Dim adoRS As ADODB.Recordset
keeps giving me no user defined types
-
May 30th, 2006, 09:42 AM
#2
Re: compile error
You need to set a reference to the Microsoft ActiveX Data Objects Library X.X (where X.X is the latest version you have on your machine. I have 2.7 but some folks have 2.8).
-
May 30th, 2006, 09:51 AM
#3
Thread Starter
Frenzied Member
Re: compile error
thanks, worked.
also..
VB Code:
Private Function SQL_Connect()
Set cn = New ADODB.Connection
cn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=<server>;PORT=3306;DATABASE=db;USER=<user>;PASSWORD=<pass>;OPTION=3;"
cn.Open
Set adoRS = New ADODB.Recordset
End Function
i call this on form_load to connect to the database. How can i set a boolean variable to true/false depending if the connection to the databse was successful..
this way, if im doing sql statements throughout the proggy i can check if the bool variable is true first!
-
May 30th, 2006, 09:56 AM
#4
Re: compile error
VB Code:
If cn.State = adStateOpen Then
VB sets the boolean for you.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|