>Could it be a pathing issue? Your stored procedure opens tables, but you should keep in mind that when using VFP through an ASP page there is not SET PATH in effect. There are also some other settings that you need to be aware of, like for example SET EXCLUSIVE.
>
I don't think it's a path thing because the tables all belong to the DBC and they're in the same dir as the DBC anyway.
Here's something weird. I modified the vbs code slightly, so now I go straight to the Stored Procedure and fetch a new number. If I then do an insert on the table, it works fine. It's like the connection wants to be "warmed up" before it takes the SP call. The downside to this is that on the first "warmup" call I get 1, but the actual insert gives me a 2. The next time I run the .vbs I get 3, but the actual insert gives me a 4, and so on.
A workaround is to just call the SP to get the next ID and make that part of my insert statement, but that doesn't smell right. There has got to be a way to just use the SP.
?
strCon = "Provider=VFPOLEDB.1;Data Source=" & _
E:\db\ForumHowardCraftCom\forum.DBC;" & _
Password="""";Collating Sequence=MACHINE"
Set AdoCon = CreateObject("ADODB.Connection.2.7")
With AdoCon
.ConnectionString = strCon
.CursorLocation = 2
.Mode = 16
.Open
End With
arNothing = AdoCon.Execute("AutoIncKey('tablea','author_id')").GetRows
WScript.Echo arNothing(0,0)
AdoCon.Execute("Insert Into tablea (UserName) Values ('stevec')")