FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

VB + MYSQL

 


masaru
HI THERE....

i'm just want to ask to everyone that can solve my problem.

my situation:
I have an application that developed with VB6. I also have a MySQL database that installed in Window2000 server.

my question:
how i want to connect to the database?
TRY-- using odbc = Fail
TRY-- using DSN less = fail

i sent along to you the connection code:

Code:

Public Function myDB(Sqltxt As String, DBmode As Integer) As ADODB.Recordset

Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim LockType As String

Set db = New ADODB.Connection

'CONNECTION
db.ConnectionString = "Driver={mySQL ODBC 3.51 Driver};Server=svrums;Port=3306;Option=3;Database=UMS;Uid=root;Pwd=UMS;"

db.CursorLocation = adUseClient
db.Open

'RECORDSET
Set rs = New ADODB.Recordset
rs.Open Sqltxt, db, adOpenDynamic, DBmode, adCmdText

Set myDB = rs

'adLockBatchOptimistic
'adLockOptimistic
'adlockoptimistic
'adLockReadOnly

End Function
MrBaseball34
masaru wrote:
<SNIP>

Port=3306

<SNIP>



Is that port open on both ends of the connection?
Check your firewall.
kv
Make sure you have installed mysql driver on the client where your vb code is running. You can get the driver at
http://dev.mysql.com/downloads/connector/odbc/3.51.html
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.