Access Stored Procedure (Query) problem

T

Tom Vukovich

I have an existing VB6 program that i am porting to VB.NET. It is a real
time data collection program that stores the data in an access database. The
program uses stored procedures to insert or update the data. The code is
below.

var(0) = byID
var(1) = intIndex
var(2) = intMPI
var(3) = lngCount
var(4) = sinMC
var(5) = CSng(lngCount * sinMC)
var(6) = gMeter_Reply.byFlags
var(7) = 0.1
var(8) = Meter_Info(intMtrNumber).intDBMtrIndex(intChannelnum) + 1
var(9) = dtInterval_Date
var(10) = varArray(12)
Try
Dim intRecord As Integer
cmdMeterInsert.Execute(intRecord,
var,ADODB.CommandTypeEnum.adCmdStoredProc)
Catch ex as exception

Connection method is:

strgsDatabase = GetSetting(gstrAppName, "Settings", "Database", "")
strConnect = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source="




This routine always works the first time but fails with the following error
on subsequent attempts.

"Expected query name after EXECUTE."

I hope someone can tell me what i am missing.

Thanks

tv
 
M

Mike Culver

Tom -

Unless something has changed (I don't claim to be an Access expert), Access
does not support stored procedures. You'll need to use either SQL Server,
or its desktop cousin -- MSDE.

Rgds,
Mike
 
J

Joe Fallon

Jet 4.0 does support stored procedures in Access code.
But I have never used them.

I don't know the cause of the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top