Home > Software engineering >  VB to connect the Mysql 5.1.37 ali cloud database
VB to connect the Mysql 5.1.37 ali cloud database

Time:09-20


ODBC to connect the Mysql 5.1.37 ali cloud database!
But unable to connect successfully when using VB call
A 64 - bit operating system is Windows, I download the ODBC is 32 bit!
Dim cn As New ADODB. Connection
Dim the rs As New ADODB. You

Copy from the Internet with VB6.0 by use of the code is as follows:
Dim strCn As String

Dim db_host As String
Dim db_user As String
Dim db_pass As String
Dim db_data As String

Dim As SQL String

Db_host="bdm286382480.my3w.com"
Db_user="bdm286382480"
Db_pass="057464418825"
Db_data="https://bbs.csdn.net/topics/bdm286382480_db"

StrCn="DRIVER={MySQL ODBC DRIVER 5.1};" & _
"SERVER=" & amp; Db_host & amp; ";" & _
"The DATABASE=" & amp; Db_data & amp; ";" & _
"UID=" & amp; Db_user & amp; "; The PWD="& amp; Db_pass & amp; ";" & _
"OPTION=3; STMT=SET NAMES GB2312 "

Cn. Open strCn

CodePudding user response:

A 64 - bit operating system is Windows, download the ODBC is 32-bit!

CodePudding user response:

Since ODBC can even, with ODBC directly connect it for you

STRCN="DSN=aliyun; Uid=UserID. The PWD=Passwd;"

CodePudding user response:

In a 64 - bit Windows:
64 exe and DLL in the directory c: \ Windows \ sys tem32 directory.
32 bit exe and DLL in the directory c: \ Windows \ sys wow64 directory.
So pay attention to:
In win64 system registered under 32-bit ocx DLL to 32 ocx or copy the DLL to the c: \ Windows \ syswow64 \ directory,
And registered to c: \ Windows \ syswow64 \ regsvr32 XXXXXXX ocx or DLL
Under win64 a system set up 32-bit programs use a database alias to c: \ Windows \ \ syswow64 \ cliconfg exe
Under win64 a system set up a 32-bit application system DSN to c: \ Windows \ \ syswow64 \ odbcad32 exe
A 64 - bit Windows platform attention point of the file system redirection http://www.cnblogs.com/jiake/p/4981555.html
64 - bit Windows platforms attention point of the registry to redirect http://www.cnblogs.com/jiake/p/4956218.html
  • Related