473,473 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Feed multiple parameters from a stored procedure into Access DB

1 New Member
I have just started working with MySQL and converting one of our company's larger database. What I want to do is send a variable to the stored procedure and return another variable to access for testing. I keep getting the error, expected 2 got 1 when I execute the below code:

Dim ds As ADODB.Recordset
Dim Comm As ADODB.Command
Dim SQL As String
Dim OConn As Connection
Dim Part As String
Dim Filling As String
Dim myPam As ADODB.Parameter, myparam2 As ADODB.Parameter

Part = "T24488-0000-000" (equals form value, just setting variable to test)

Dim intRowsReturned As Integer

Set OConn = New ADODB.Connection

OConn.ConnectionString = "Driver={MySQL ODBC 3.51 Driver};" & _
"Server=servername;" & _
"Database=databasename;" & _
"User=user;" & _
"Password=password;" & _
"Option=3;"

OConn.CursorLocation = adUseClient
OConn.Open

Set Comm = New ADODB.Command
Set ds = New ADODB.Recordset

Comm.ActiveConnection = OConn
Comm.CommandText = "sp_STIFillingYarn"
Comm.CommandType = adCmdStoredProc
Set myPam = Comm.CreateParameter("@snum", adVarChar, adParamInput, 50, Part)
Comm.Parameters.Append myPam
myPam.Value = Part


'Code crashed on this line
Set ds = Comm.Execute

Filling = ds.Fields.Item("@FillYarn")

Please help.
May 7 '07 #1
0 1380

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Dieter Gasser | last post by:
I have two SQL Server stored procedures, PROC1 and PROC2. PROC1 has about 50 input parameters. PROC2 is the main procedure that does some data modifications and afterwards calls PROC1 using an...
1
by: zlatko | last post by:
I use a stored procedure that is calling several other stored procedure which update or append values in several tables. All of them are stored procedures with input parameters by which they filter...
2
by: zlatko | last post by:
There is a form in an Access Project (.adp, Access front end with SQL Server) for entering data into a table for temporary storing. Then, by clicking a botton, several action stored procedures...
3
by: DarthMacgyver | last post by:
Hello, I recently wrote a survey application. Each question is very similar. The first questions gives me a problem when there are multiple people taking the survey (The Database connection...
8
by: Mark Flippin | last post by:
This is for a reporting problem using: Access 2000 SQL Server 2000 Both at SP3 I've a stored procedure in SQL Server 2000 which builds a result set from a disparate set of tables, utilizing...
7
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
12
by: shank | last post by:
I'm trying to use online samples for submitting multiple records from ASP into a stored procedure. Failing! Through the below form, a user could be submitting many records at a time. I'm not...
12
by: Scott | last post by:
Front-end Access 2000 I have a stored procedure that has 2 parameters BusinessUnitID and Year. It returns multiple record sets (5 to be exact). I thought I could use a Pass through query but...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.