|
-
Sep 28th, 2000, 12:44 PM
#1
Hi there, I really would like some assitance in writing to my database.
Now here's my problem: I'm able to read from my database but when ever I attempt to update it I get an error message on my IE5 browser.
Here's the code that are working fine:
<%
set DBObj = server.createobject("ADODB.connection")
DBObj.open "TaskManager"
sqlquery = " SELECT Month, Day, Date FROM Selected_Month WHERE Month = 'October' "
set RSGetMonth = DBObj.execute(sqlquery)
DayOfWeek = RSGetMonth("Day")
DateOfWeek = RSGetMonth("Date")
DBObj.close
response.write "<p> Day of week =" &DayOfWeek& "</p>
response.write "Date of week = " &DateOfWeek
%>
The above reads the appropriate data from the database but when I try the following I get error messages:
<%set DBObj = server.createobject("ADODB.connection")
DBObj.open "TaskManager"
query = " UPDATE Calendar SET Date = 2 WHERE Day = 'Monday1' "
set RS = DBObj.execute(query)
DBObj.close
%>
I get error on the "set RS = DBObj.execute(query)" line
saying: Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] syntas error in UPDATE statement
If you could provide me with the initital few lines of codes to establish a connection in order to write to the database it will be very much appreciated.
-
Sep 28th, 2000, 07:16 PM
#2
Frenzied Member
Your trying to assign a recordset to an action query that does not return a dataset.
An update statement will not return a dataset of the records that were updated.
Try this instead:
Code:
DBObj.execute query
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|