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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert statment problems

Status
Not open for further replies.

fluxdemon

MIS
Nov 5, 2002
89
US
My webpage platform is sun one asp/mySql and I am having a problem with the following insert statement. The statement works in the query analyzer and I get a generic error page.

(id is a timestamp field)
insert into cv_archive
select * from cv
where id = 20040730134934

set conn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.Recordset")
connString="DRIVER={MySQL};...
conn.open connString
sql = "insert into cv_archive
sql = sql & select * from cv
sql = sql & where id = 20040730134934
conn.execute(sql)
conn.close
set conn=nothing
 
I don't know all that much about ASP, but doesn't this:

conn.open connString
sql = "insert into cv_archive
sql = sql & select * from cv
sql = sql & where id = 20040730134934

have a decided lack of necessary quotes?


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
I forgot to add those when I deconstructed the actual functions to show I had all necessary items to use the statement. I am asking about the sql statement.
 
Does the query actually do something, or does it just not throw an error?

I think that if you don't put your timestamp value in quotes, MySQL will treat it as an integer.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top