run-time error '-2147467259(80004005)':
[microsoft][ODBC DRiver Manager]data source name not found and no default driver specified
hello
im running vb6 with mysql, and im using xampp database system.i received the error message above when im trying to access it.actually this was an unfinished program, and i was asked to finish it.im new in mysql and xampp so i don't know where to start. the error is pointing to cn.Open. below is the complete code for you to check.
Code:Public Sub conek(cnstr As String) myserver = "localhost" txtuser = "new" txtpass = "" mydatabs = "testdb" Set cn = New adodb.Connection Set rs = New adodb.Recordset cn.CursorLocation = adUseClient 'cnS = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=" & myserver & ";PORT=3306;" & _ "DATABASE=" & mydatabs & ";USER=" & txtUsername & ";PASSWORD=" & txtPassword & _ ";OPTION=3;" cnS = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=" & myserver & ";PORT=3306;" & _ "DATABASE=" & mydatabs & ";USER=" & txtUsername & "; OPTION=3;" cn.ConnectionString = cnS cn.Open 'cnstr = "select * from testtbl" rs.Open cnstr, cn, adOpenDynamic, adLockOptimistic 'rs.MoveFirst End Sub





Reply With Quote