Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding data to a recordset is causing me grief

Status
Not open for further replies.

jazzz

Technical User
Feb 17, 2000
433
US
being a novice to ADO I created an Access query, which I would like to use to add data to my online database. My question is this:

I make my connection just fine but when I attempt to add the data to the query and close my connection I receive an error that the operation is not allowed. Here is my code I have read the book but cannot figure out what I am doing wrong. I do see every example is using a table not a query it this possibly my problem?

Dim rsItem
Dim blnNew

Set rsItem = Server.CreateObject("ADODB.Recordset")
rsItem.Open "qryItem", objConn, adOpenForwardOnly, adLockOptimistic, adCmdStoredProc


I can also use an SQL query to add data if that would be better? Here is my problem why I can't just use a table. My on line form uses combo boxes where I list the items for the user. That information is pulled from tables in the database and basically are numbers but the user views their name. So when I capture the info from the form I am capturing text not numbers. I built a query to compensate for this and I would like to add the data to my main query. Is this doable?

Thanks in advance.

Life's a journey enjoy the ride...

jazzz
 
I am not sure but have you tried changing adCmdStoredProc to adCmdTable or adCmdTableDirect to see if that helps?

Just a guess.



Hope this helps.

OnTheFly
 
I got it figured out. Thanks. If anyone would like to see the code I would be glad to share it here.

Life's a journey enjoy the ride...

jazzz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top