Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 VB 6.0 and MySQL

Author  Topic 

jriis
Starting Member

1 Post

Posted - 2002-10-18 : 05:41:43
Hi

I am looking for an easy way to connect from Visual Basic 6.0 to a MySQL database.

Anyone got a simple way to do this or is it more complex.



Regards

Jan Riis Soerensen

KnooKie
Aged Yak Warrior

623 Posts

Posted - 2002-10-18 : 07:50:42
These are connection strings for both ODBC or OLEDB (recommended). We have a class module to easily specify our connection anywhere in code.

'**********************************************************************************************
' ODBC CONNECTION STRING
'**********************************************************************************************
'cnn1.ConnectionString = "Data Source=Sql_Tos;user ID=" & Me.txtUserName & ";password=" & Me.txtPassword 'LIVE SYS CONNECTION
cnn1.ConnectionString = "Data Source=Sql_Tos_dev_uk_2;user ID=" & Me.txtUserName & ";password=" & Me.txtPassword 'TEST SYS CONNECTION
cnn1.Open
'**********************************************************************************************
'**********************************************************************************************

'**********************************************************************************************
' OLEDB CONNECTION STRING
'**********************************************************************************************
'***** OLE DB connection string test - works but problems with insert SPs with returning of Auto ID's
'cnn1.ConnectionTimeout = 15
'cnn1.Provider = "SQLOLEDB"
'''LIVE SYS
'cnn1.Open "Data Source=Tempest_SQL1;Initial Catalog=Sql_Tos;User ID=" & Me.txtUserName & ";password=" & Me.txtPassword
'''TEST SYS
'cnn1.Open "Data Source=Dev_UK_2;Initial Catalog=Sql_Tos;User ID=" & Me.txtUserName & ";password=" & Me.txtPassword
'**********************************************************************************************
'**********************************************************************************************


===========
Paul
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-10-18 : 07:51:08
Hi

I would guess using ADO, you might want to check MSDN for some info on that. Or, maybe look at a MySQL site. We mainly deal with SQL Server here.

Damian
Go to Top of Page
   

- Advertisement -