469,623 Members | 927 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

Need help calling a stored procedure from VB6

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

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

[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.


The journey is the reward.
Jul 20 '05 #1
0 1842

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Anthony Robinson | last post: by
2 posts views Thread by Dan Flynn | last post: by
2 posts views Thread by Woody Splawn | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.