| Author |
Topic Search Topic Options
|
ngaisteve1
Groupie
Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
|
Post Options
Thanks(0)
Quote Reply
Topic: ADODB.Recordset.1 error 80004005 Posted: 20 February 2003 at 3:31am |
ADODB.Recordset.1 error '80004005'
SQLState: 42000 Native Error Code: 1064 [TCX][MyODBC]You have an error in your SQL syntax near '' at line 1
/intra2003/announcement_add.asp, line 15
I don't know why I got this error. I can't locate where is the error.
tmpTitle = request.form("ann_title_fr") tmpContent = request.form("ann_content_fr") tmpFrom = request.form("ann_from_fr")
Dim conn 'declare connection object. Dim rs Dim conString 'declare a temp object.
Session.timeout = 15
set conn = Server.CreateObject("ADODB.Connection") 'create connection object. set rs = Server.CreateObject("ADODB.Recordset") 'create connection object. set Session("MyDB_conn") = conn 'set a session timeout.
conString = "Driver={Mysql};Server=localhost; Database=intranet;UID=citylink; PWD=city12017;" conn.Open( conString ) 'open the connection object to connect to citylink database.
'sql = "SELECT * FROM announcement" rs.Open "announcement", conn, 3, 3
rs.addnew
rs("title") = tmpTitle rs("content") = tmpContent rs("from") = tmpFrom
rs.update response.write "Done."
|
 |
MorningZ
Senior Member
Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
|
Post Options
Thanks(0)
Quote Reply
Posted: 20 February 2003 at 8:32am |
|
Regarding:
rs.Open "announcement", conn, 3, 3
is "annoucement" a stored procedure of some sort?
|
|
Contribute to the working anarchy we fondly call the Internet
|
 |
skyworld
Senior Member
Joined: 12 December 2002
Location: United States
Status: Offline
Points: 134
|
Post Options
Thanks(0)
Quote Reply
Posted: 20 February 2003 at 8:39am |
|
about getting rid of the ' before 'sql = "SELECT * FROM announcement"d
|
 |
skyworld
Senior Member
Joined: 12 December 2002
Location: United States
Status: Offline
Points: 134
|
Post Options
Thanks(0)
Quote Reply
Posted: 20 February 2003 at 8:40am |
ooops ...
yours:
'sql = "SELECT * FROM announcement"
Should be... sql = "SELECT * FROM announcement"
|
 |
MorningZ
Senior Member
Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
|
Post Options
Thanks(0)
Quote Reply
Posted: 20 February 2003 at 8:48am |
|
not sure how you thought that would help, from that point forward there is no reference to the variable "sql"
|
|
Contribute to the working anarchy we fondly call the Internet
|
 |
skyworld
Senior Member
Joined: 12 December 2002
Location: United States
Status: Offline
Points: 134
|
Post Options
Thanks(0)
Quote Reply
Posted: 20 February 2003 at 8:53am |
|
atleast i tried though ...
|
 |
ngaisteve1
Groupie
Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
|
Post Options
Thanks(0)
Quote Reply
Posted: 20 February 2003 at 7:41pm |
Actually, I found out the problem later.
rs("from") = tmpFrom
I got a reserved word (from) for my field.
After I took this out, it works.
Thanks nevertheless.
Edited by ngaisteve1
|
 |