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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help hooking to MySQL using VB6

Status
Not open for further replies.

TomSwingruber

Programmer
May 21, 2003
21
0
0
US
I am attempting to hook into MySQL on a Linux box
using Visual Basic on a Windows box.

The particulars...

MySQL server machine
name Linny
local IP address 192.168.1.123
RedHat 9
MySQL 4.1.9-0

MySQL client machine
name Winny
local IP address 192.168.1.124
Windows 98se
Visual Basic 6
MySQL ODBC 3.51


I set up a simple database 'tester' with a single table
(which has a couple columns to hold first and last names).
Also, I gave the user 'somebody' access to the table.

A quick PHP program, running on the Linux box, is able
to access the database and table with no problems.

Hooking to MySQL from the Windows box, using the "ODBC
Data Source Administrator" (found in the control panel),
lets me make and test a connection, no problem.

The VB program is as follows...

| Private Sub Form_Load()
|
| Dim conn As ADODB.Connection
| Dim cs As String
|
| Set conn = New ADODB.Connection
| conn.CursorLocation = adUseClient
| cs = "DRIVER={MySQL ODBC 3.51 Driver};" _
| & "SERVER=192.168.1.123;" _
| & "DATABASE=tester;" _
| & "UID=somebody;" _
| & "PWD=sbpass777;" _
| & "OPTION=" & 3
|
| conn.ConnectionString = cs
| conn.Open
|
| End Sub

When I run this program, I get...

Run-time error '-2147418113 (8000ffff)':
Unexpected failure

However, if I change the password to something bogus,
I get instead...

Run-time error '-2147467259 (80004005)':
[MySQL][ODBC 3.51 Driver]Access denied for user
'somebody'@'Winny' (using password: YES)


Any help would be appreciated...
Thanks!
 
well, i had tried that earlier, but just in case,
I just tried it again... same results... but thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top