SunQuest
 
           MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old January 17th, 2005, 04:06 AM
adventure_ke adventure_ke is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 7 adventure_ke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ASP AND MYSQL PROBLEM Database Insert/update Problem

Please Help
I have an database in MYSQL, with the table of Users.
Here there these fields: ID (Int), Username (varchar), Password (varchar), City (varchar), COuntry (varchar), EMail (varchar), Accomplishments , Issues, Plans.
The last there are LONGTEXT Fields

This part of my ASP, takes information from a form which has the Accomplishments , Issues, Plans, looks at session ID, and goes to the specific persons record and add the accom., issues, and plans. No changes are made to the other fields.

Error is


Microsoft OLE DB Provider for ODBC Driverserror '80040e14'

[MySQL][ODBC 3.51 Driver][mysqld-4.1.7-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 /project/report_database.asp, line 41

Line 41: rsUpdateEntry.Open strSQL, adoCon


The code from the point where the form submit button is click goes to this ASP page:
Quote:

<%

'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsUpdateEntry 'Holds the recordset for the record to be updated
Dim strSQL 'Holds the SQL query for the database
Dim lngRecordNo 'Holds the record number to be updated
'Read in the record number to be updated


lngRecordNo = Request.QueryString("ID") //ID from the QueryString is now IngRecordNO
'Create an ADO connection odject

Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open ";Driver={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=t;USER=p;PASSWOR D=l;OPTION=3;" //Connect to Database

'Create an ADO recordset object
Set rsUpdateEntry = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database

strSQL = "SELECT tblUsers.* FROM tblUsers WHERE ID=" & IngRecordNo //select everything from tblusers table where ID has been read

'Set the cursor type we are using so we can navigate through the recordset
rsUpdateEntry.CursorType = 2
'Set the lock type so that the record is locked by ADO when it is updated
rsUpdateEntry.LockType = 3
rsUpdateEntry.CursorLocation = 3
'Open the tblComments table using the SQL query held in the strSQL varaiable
rsUpdateEntry.Open strSQL, adoCon

if session("UserID") = rsUpdateEntry("User_passwd") Then //Use session to validate

'Update the record in the recordset
rsUpdateEntry.Fields("name") = Request.Form("Name")
rsUpdateEntry.Fields("accomplish") = Request.Form("Accomplish")
rsUpdateEntry.Fields("issue") = Request.Form("Issue")
rsUpdateEntry.Fields("plan") = Request.Form("Plan")
'Write the updated recordset to the database

rsUpdateEntry.update
Response.Redirect"main.asp?ID=" & reUpdateEntry("ID") & ""

'Reset server objects
rsUpdateEntry.Close
Set rsUpdateEntry = Nothing
Set adoCon = Nothing
Else

Response.Redirect "unauthorized.htm"
End If
%>


Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > ASP AND MYSQL PROBLEM Database Insert/update Problem


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 5 hosted by Hostway