By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,743 Members | 1,122 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,743 IT Pros & Developers. It's quick & easy.

Need help calling a stored procedure from VB6

P: n/a
First, let me introduce myself to the group. My name is Rich and I've been
doing databases for about 25 years with the last 10 being pretty much MS SQL
Server. I've become intrigued with MySQL and would love to use it on a
project. I'm trying to work with stored procedures and am having a problem.
Here goes:

Software: Windows NT, VB6, MySQL 5.0.01-alpha-nt,MySQL ODBC 3.51

Here's my code:

Dim rs As adodb.Recordset
Dim cmd As adodb.Command
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = cn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "getproducers"
Set rs = CreateObject("ADODB.Recordset")
Set rs.Source = cmd
rs.LockType = adLockReadOnly
rs.CursorLocation = adUseClient
rs.CursorType = adOpenStatic
rs.Open

The stored procedure just does a simple. select on a table. I get this error
message:

[MySQL][ODBC 3.51 Driver][mysqld-5.0.1-alpha-nt-log]You have an error in
your SQL Syntax; check the manual that corresponds to your MySQL server
version for the right syntax to use near '{ call getproducers }' at line 1.

Things I've tried:
Switch to MyOleDB. No stored procedure support for MySQL
Changed cmd.CommandText = "getproducers" to cmd.CommandText =
"getproducers()"- no go.

Any help would be greatly appreciated.

Thanks,
Rich

--
The journey is the reward.
Jul 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.