SunQuest
           ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Try It Free
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old August 29th, 2003, 06:07 AM
rossvdl rossvdl is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 5 rossvdl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile Spot the syntax error!!!

Hi - this is my first post in these forums and I really hope that someone can help me!!! The problem is that I keep getting the following error:
-----
Microsoft JET Database Engine error '80040e14'

Syntax error in INSERT INTO statement.

editor/add2.asp, line 105
-----
Now, I have fairly limited knowledge of databases and asp but that's normally caused by some messed up syntax or alternatively a reserved name being used. I dont think I'm using a reserved name but cant work out where my problem is.

I'd really appreciate some help from someone in finding out where I've gone wrong in my code...

THE CODE:---------->

<% strTitle=Request.form("Title")%>
<% strTitle=Replace(strTitle, "'", "''") %>

<% strCategory=Request.form("Category")%>
<% strCategory=Replace(strCategory, "'", "''") %>

<% strImgDesc=Request.form("ImgDesc")%>
<% strImgDesc=Replace(strImgDesc, "'", "''") %>

'etc etc (I do this with like 20 different variables so I wont include them all)

'then...
<% which = strID %>

<% Set connDataServ=Server.CreateObject("ADODB.Connection")
connDataServ.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"DATA SOURCE=" & server.mappath("../DataServ.mdb")

sqlDataServ="INSERT INTO Articles (Title, Category, [Date], FirstPara, OtherParas, [Image], ImgDesc, ImgSrc, [Headline], MHometeam, MAwayteam, MHomescore, MAwayscore, MStadium, MHometeamkit, MAwayteamkit, MType, [MMatchdate], [URL_Table], [URL_Fixtures], [URL_Results], OtherClub) VALUES ("
sqlDataServ = sqlDataServ & "'" & strTitle &"', "
sqlDataServ = sqlDataServ & "'"& strCategory &"', "
sqlDataServ = sqlDataServ & "'"& CDate(strDate) &"', "
sqlDataServ = sqlDataServ & "'"& strFirstPara &"', "
sqlDataServ = sqlDataServ & "'"& strOtherParas &"', "
sqlDataServ = sqlDataServ & ""& strImage &", "
sqlDataServ = sqlDataServ & "'" & strImgDesc &"', "
sqlDataServ = sqlDataServ & "'"& strImgSrc &"', "
sqlDataServ = sqlDataServ & ""& strHeadline & ", "
sqlDataServ = sqlDataServ & "'" & strMHometeam &"', "
sqlDataServ = sqlDataServ & "'" & strMAwayteam &"', "
sqlDataServ = sqlDataServ & "'" & strMHomescore &"', "
sqlDataServ = sqlDataServ & "'" & strMAwayscore &"', "
sqlDataServ = sqlDataServ & "'" & strMStadium &"', "
sqlDataServ = sqlDataServ & "'" & strMHometeamkit &"', "
sqlDataServ = sqlDataServ & "'" & strMAwayteamkit &"', "
sqlDataServ = sqlDataServ & "'" & strMType &"', "
sqlDataServ = sqlDataServ & "'"& CDate(strMMatchdate) &"', "
sqlDataServ = sqlDataServ & ""& strURL_Table &", "
sqlDataServ = sqlDataServ & ""& strURL_Fixtures &", "
sqlDataServ = sqlDataServ & ""& strURL_Results &", "
sqlDataServ = sqlDataServ & "'" & strOtherclub &"')"
Set rsDataServ=connDataServ.Execute(sqlDataServ)
%>

--------

I've attached the full asp file in case anyone needs to look at the rest of it.

Thanks for any help anyone can give me.
Attached Files
File Type: asp add2.asp (4.2 KB, 198 views)

Reply With Quote
  #2  
Old August 29th, 2003, 08:23 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Look inside the file I've attached for you!

---BEGIN EDIT---
Oh and I did forget to mention that Access uses the # symbol for Dates so be on the lookout for that!!!
---END EDIT---


Hope this helps!
Sincerely

Vlince
Attached Files
File Type: asp add2.asp (8.6 KB, 237 views)

Last edited by Vlince : August 29th, 2003 at 08:28 AM.

Reply With Quote
  #3  
Old August 29th, 2003, 09:20 AM
rossvdl rossvdl is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 5 rossvdl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up

I cannot thank you enough for your help. I will try it out now 2 see if it works and will report back.

Thanks again

Reply With Quote
  #4  
Old August 29th, 2003, 09:41 AM
rossvdl rossvdl is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 5 rossvdl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
What you said helped a great deal. Unfortunately I'm now getting an error which I'm struggling to debug as well...

---

Microsoft JET Database Engine error '80004005'

Operation must use an updateable query.

/wits/wits03/testdummy/editor/add2.asp, line 182

---

Line 181/182...
Const adExecuteNoRecords = 128
objConn.Execute strSql, adExecuteNoRecords

---

Not a clue what to do now!? Sorry to keep bothering you, but do you have any suggestions?

Thanks very much.

Reply With Quote
  #5  
Old August 29th, 2003, 09:48 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Here, google a little and voila!


http://www.google.com/search?source...pdateable+query


Hope this helps!
Sincerely

Vlince

Reply With Quote
  #6  
Old August 29th, 2003, 10:26 AM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 6 m 22 sec
Reputation Power: 76
Just for future reference: When you get asp and other microsoft errors, go look them up at the microsoft site. They usually tell what causes the error and how to fix it. Try that first.

Reply With Quote
  #7  
Old August 29th, 2003, 12:09 PM
rossvdl rossvdl is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 5 rossvdl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I did look on Google (I do so whenever I have asp problems) but it just so happens that I had two errors that I didn't know how to fix. I also had a look at the Microsoft website. Thanks for the help you gave me anyway. I dont want to bother you anymore, but if there is a one-line solution to my problem like I think (hope!) there is, plz do let me know!

Thanks for all your help.

Reply With Quote
  #8  
Old August 29th, 2003, 12:15 PM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 6 m 22 sec
Reputation Power: 76
Most likely cause: IUSER doesn't have write privelidges for the database. http://support.microsoft.com/defaul...b;EN-US;q175168 has the 4 most common reasons for the error.

Reply With Quote
  #9  
Old August 29th, 2003, 12:15 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
---BEGIN QUOTE---
I dont want to bother you anymore
---END QUOTE---

Who said anything about being bothered?

That is nonsense!

Are you saying that the google link I gave you didn't have an answer for your error message? Are you sure?

Not that I want to doubt you or anything but there isn't 10 000 reasons for the type of error you're having.

Make sure the <IUSER_machine_name> has the rights/permission to write on the database...make sure of that!

Hope this helps!
Sincerely

Vlince

Reply With Quote
  #10  
Old August 29th, 2003, 12:23 PM
rossvdl rossvdl is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 5 rossvdl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile

No it's just that you helped me so much in that attachment already that I didn't want to ask anything more from you!

I'm a bit confused about all this IUSER_machine stuff because I never used it on previous database-asp linkups I did (I really have very limited experience in asp), so I thought there might be another reason for it. Certainly the Microsoft page on it said that that was the most likely reason. I'll see if I can fix it like that...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Spot the syntax error!!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway