Reply
Two syntax errors
Old 10-20-2004, 01:25 PM Two syntax errors
Novice Talker

Posts: 8
It's me again, with two syntax errors that I can't for the life of me figure out:

====
The first error:

Error Type:
Microsoft OLE DB Provider for SQL Server
(0x80040E14)
Line 1: Incorrect syntax near ')'.
/1076044226/dbridge/learner.asp, line 53

Code is as follows, with line 53 the last line:

strSQL = "SELECT tblCourseClient.CourseID, tblCourseClient.ClientID, tblClient.ClientCWareTitle, tblClient.ClientNumber "
strSQL = strSQL & "FROM tblCourseClient INNER JOIN tblClient ON tblCourseClient.ClientID = tblClient.ClientID "
strSQL = strSQL & "WHERE ((tblCourseClient.CourseClientID) = " & CCID & ") "
rs.Open strSQL, db

====
The second:

Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
Line 1: Incorrect syntax near ','.
/1076044226/dbridge/learner.asp, line 115

Here's the code, line 115 is the last line (db.Execute(strSQL):

strSQL = "INSERT INTO tblAccess "
strSQL = strSQL & "(MemberID, CourseID, AccessStarted, AccessStatus, AccessType, ClientID, AccessStart, AccessEnd, AccessCompleteBy) "
strSQL = strSQL & "VALUES (" & MRLearnerID & ", " & CourseID & ", 1, 'Active', 0, " & ClientID & ", '" & StartDate & "', '" & EndDate & "', '" & CompleteDate & "') "
db.Execute(strSQL)

======

Any help will be much appreciated!
gadfly is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 10-20-2004, 01:43 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
there's a problem with the SQL query your trying to execute

On the first one, right before line 53, put
response.write strSQL
then copy/paste here the results and we can analyse the query better.

the seconed one...
Are you using an Access database? If so, dates must be surrounded by # and not '
You can try response.write with that one too. Do all your variables that your inserting contain a value? If any of them do not, then it will break.
Anacrusis is offline
Reply With Quote
View Public Profile Visit Anacrusis's homepage!
 
Old 10-20-2004, 03:59 PM
Novice Talker

Posts: 8
OK, here's what I get:

SELECT tblCourseClient.CourseID, tblCourseClient.ClientID, tblClient.ClientCWareTitle, tblClient.ClientNumber FROM tblCourseClient INNER JOIN tblClient ON tblCourseClient.ClientID = tblClient.ClientID WHERE ((tblCourseClient.CourseClientID) = )
Microsoft OLE DB Provider for SQL Server error '80040e14'

Line 1: Incorrect syntax near ')'.

/1076044226/dbridge/learner.asp, line 53
gadfly is offline
Reply With Quote
View Public Profile
 
Old 10-20-2004, 04:01 PM
Novice Talker

Posts: 8
So it's not pulling in a value for CCID?
gadfly is offline
Reply With Quote
View Public Profile
 
Old 10-20-2004, 09:08 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Sorry for the delay in my response, I just now had a chance to take a look at your post.

Yes, it looks like CCID is getting nothing assigned to it. You'll need to go back an re-evaluate how it gets populated.
Anacrusis is offline
Reply With Quote
View Public Profile Visit Anacrusis's homepage!
 
Reply     « Reply to Two syntax errors
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12930 seconds with 12 queries