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

MySQL Stored Procedures 1

Status
Not open for further replies.

jake007

Programmer
Jun 19, 2003
166
US
I am new to MySQL and was wondering, how do you call a stored MySQL procedure from VB6?

Jake
 
Ran a search, did not find anything specific for MySQL, any other ideas anybody?

Jake
 
and did you try any of the code you found with your database?

Most of the code I found will work regardless of which DB you are using.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
>regardless of which DB

Depends. Older versions of MySQL didn't actually have stored procedures, and the implementation in the current version is still apparantly falls short of say Oracle or SQL Server
 
I am using v5 so it does have support for stored procedures. strongm, any ideas were I can find some good docs on call mysql stored procedures. Have not found anything specific on thi forum. Any help would be greatly appreciated. (Also searched the hell out of google but nothing really helpful yet)

Thanks,

Jake
 
Well, supposedly you call a MySQL stored proc from VB the same way you would call a SQL Server stored proc:

Dim conn As ADODB.Connection

conn = New ADODB.Connection

conn.ConnectionString = "blah blah blah"
conn.Open

Dim cmd As ADODB.Command
cmd = New ADODB.Command

cmd.ActiveConnection = conn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "MySQLStoredProcName"
cmd.Execute

However, after a quick web search I have found that the current version of the MyODBC driver (3.51.11, I believe) does not support stored procedure calls. Unfortunately, it seems that you will have to wait until a new version of MyODBC that supports stored procs is made available. I did see some information that indicates that you can call MySQL stored procs in VB .NET, though.

Hope this helps.


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Thanks jebenson, I will investigate the ODBC Driver issue and proceed fromn there.

jake
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top