|
-
Nov 19th, 2000, 12:42 PM
#1
Thread Starter
Fanatic Member
this should be simple but.......
I have an ASP page that has a form w/ four text fields and on hidden field. it calls a page called update that has this code in it.
++++++++++++++++++++++
dim FN,LN,EM,PN,SH
FN = request.form("theDate") 'date of the event
LN = request.form("location")'location of the event
EM = request.form("hours") 'time of the event
PN = request.form("title") 'main heading for event(title)
SH = request.form("description")'text describing the event w/ some detail
PW = request.form("ID")
SQL = "Update main_event set date='" & FN & "', location='" & LN & "'"
SQL = SQL & ", heading='" & EM & "', event='" & PN & "'" & _
", hours='" & SH & "', Password='" & PW & "' where ID =" & request.form("id")
response.write SQl 'for testing
set conn = server.createobject("ADODB.Connection")
conn.open "pnj" 'DSN is pnj
conn.execute SQl
conn.close
set conn = nothing
++++++++++++++++++++
the error I get is:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
it says there is an error on line 16 (conn.execute sql)
does anyone see anything wrong w/ this?
the really strange thing is this code I took from another project and that project would work fine. I know I am just overlooking something simple.....
thanks
-
Nov 20th, 2000, 10:12 AM
#2
Frenzied Member
I think you need a userid and PW for the connection. That info is not stored in the DSN.
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..
-
Nov 20th, 2000, 10:38 AM
#3
Thread Starter
Fanatic Member
I'm not sure I know what you meen.
correct me if I am wrong(i usually am)
the DSN points to the database. the database named pnj has a table called main_event that holds the fields named:
date, location, heading, event, hours, Password and ID.
the user already logged in using a password and username.
I really don't get this stuff. One page works fine, I copied the sql string and changed the names to fit my database and now it won't work. but the syntax is the same as the original one that did work????
thanks again
-
Nov 21st, 2000, 11:47 PM
#4
Frenzied Member
The user logging in to your application has NOTHING to do with the userid and password for the database connection.
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..
-
Nov 22nd, 2000, 01:19 AM
#5
Thread Starter
Fanatic Member
I figured it out....
my field names are 'saved' words.
date and hours I changed and now it works.
what do you meen by user id and password?
the data base is a simple access DB.
anyway it works no so no biggie.
thanks
-
Nov 22nd, 2000, 10:40 AM
#6
Frenzied Member
I guess I just assumed that you would not be accessing an Access database using ODBC..
You would need a userid & password to log into a DBMS such as SQL Server or Oracle.
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..
-
Nov 22nd, 2000, 11:22 AM
#7
Thread Starter
Fanatic Member
I should have been more descriptive...
Just a simple simple web site.
what should one use instead of ODBC when using Access?
or should I just stick w/ ODBC becouse it works?
thanks and sorry for the confusion.
-
Nov 27th, 2000, 11:57 AM
#8
Frenzied Member
Use the Jet 4.0 provider and ADO instead of ODBC. The OLEDB Jet provider is faster.
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
|