Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL Insert

Author  Topic 

oahu9872
Posting Yak Master

112 Posts

Posted - 2005-08-25 : 11:29:28
I am having trouble with a SQL INSERT statement. This is my code.

if Action = "Execute" then

Dim AddAuctAdText
Dim InsertSQL

Set AddAuctAdText = Server.CreateObject("ADODB.Command")
AddAuctAdText.ActiveConnection = MM_FarmWorld_STRING
InsertSQL = "Insert into tblAuctionAd (EventID, AdText) values (" & EventID & ",'" & AdText & "')"
AddAuctAdText.Execute
AddAuctAdText.ActiveConnection.Close

Response.Redirect("AmendAuctAd.asp")& "?EventID="& EventID

end if


I am getting the following error . . .


Microsoft OLE DB Provider for ODBC Drivers error '80040e0c'
Command text was not set for the command object.


Thanks.

ajthepoolman
Constraint Violating Yak Guru

384 Posts

Posted - 2005-08-25 : 13:14:11
Should it be this?

AddAuctAdText.Execute(InsertSQL)

Aj


Hey, it compiles.
Go to Top of Page
   

- Advertisement -