Access Stored Procedure (Query) problem

  • Thread starter Thread starter Tom Vukovich
  • Start date Start date
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
 
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
 
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.
 
Back
Top