Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: RE: sql_language digest: June 22, 2000


Message #1 by "Krishna Roopa" <roopa@t...> on Fri, 23 Jun 2000 07:53:46 +0530
Is it not possible to write direct insert statement ?

OR try to get the query using Response.write and execute it from Query
analyzer, you can easily trap the error


-----Original Message-----
From: sql language digest [mailto:sql_language@p...]
Sent: Friday, June 23, 2000 12:30 PM
To: sql_language digest recipients
Subject: sql_language digest: June 22, 2000


sql language Digest for Thursday, June 22, 2000.

1. INSERT INTO...SELECT not working

----------------------------------------------------------------------

Subject: INSERT INTO...SELECT not working
From: jprentice@e...
Date: Wed, 21 Jun 2000 14:30:34
X-Message-Number: 1

I get a 'data type mismatch in criteria expression' error with the
following code, which is located in an asp page.

strSQL = "INSERT INTO tblJobs SELECT '" & (request.form("ID")+1) & "' AS
ID, '" & request.form("frmTitle") & "' AS JobTitle, '" &
request.form("frmSummary") & "' AS Summary, '" &
request.form("frmResponsibilities") & "' AS Responsibilties, '" &
request.form("frmRequirements") & "' AS Requirements, '" &
request.form("frmAccountability") & "' AS Accountability, '" &
request.form("chkInternal") & "'AS Internal, '" &
request.form("txtInternal") & "' AS InternalDate, '" &
request.form("chkExternal") & "' AS External, '" &
request.form("txtExternal") & "' AS ExternalDate"

Note:  The code shows up here using word-wrap; it's not how it's written.

I think the error is coming from the checkboxes.  Either that or the ID.

Any ideas?

  Return to Index