Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



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

Posts: 8
Trades: 0
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
 
 
Register now for full access!
Old 10-20-2004, 02:43 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
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
 
Old 10-20-2004, 04:59 PM
Novice Talker

Posts: 8
Trades: 0
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, 05:01 PM
Novice Talker

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

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
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
 
Reply     « Reply to Two syntax errors
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.33366 seconds with 12 queries