Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB, ADO, connection to MySQL? 1

Status
Not open for further replies.

petersJazz

Programmer
Joined
Jan 28, 2002
Messages
222
Location
EU
What are the key words for connecting to mySQL? Have tried this:

Private Sub Form_Load()
Dim objRs As ADODB.Recordset
Dim strSQL As String
Dim strConnStrTest As String
Dim strConnStrProd As String
rdbTestDB.Value = True
Set objRs = New ADODB.Recordset
strSQL = "SELECT u.wName, count(*) " & _
"FROM Users u, Bugs b " & _
"WHERE u.wName = 'Peter Karlsson'"
strConnStrTest = "Provider=MYSQL;" & _
"Data Source=Projektplatsen;"
objRs.Open strSQL, strConnStrTest, adOpenForwardOnly, _
adLockReadOnly, adCmdText
End Sub

But I get Run Time error 3706, Provider cannot be found. It may not be properly installed.
 
Private Sub Form_Load()
Dim objRs As ADODB.Recordset
Dim strSQL As String
Dim strConnStrTest As String
Dim strConnStrProd As String
rdbTestDB.Value = True
Set objRs = New ADODB.Recordset
strSQL = "SELECT u.wName, count(*) " & _
"FROM Users u, Bugs b " & _
"WHERE u.wName = 'Peter Karlsson'"
'''Enter the user ID (after UID= ) and password (PWD= )
'''that you use to connect
'''in the statement below. Make sure you have created a
'''data source name in you ODBC in control panel with the
'''correct driver for the database you are using.

strConnStrTest = "DSN=Projektplatsen;UID=;PWD=;"
objRs.Open strSQL, strConnStrTest, adOpenForwardOnly, _
adLockReadOnly, adCmdText
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top