Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with upadting db

Status
Not open for further replies.

false420

Programmer
Mar 31, 2005
87
US
Im almost done with migrating everything to sql server 2000 with ms access 2002 front end. i ran into one more situation. i have fileup by software artisans used to upload a file in a form. it uploads the file fine. the form grabs all text entered into any field and updates a access database with it which will in turn update the sql server. the problem is when the code goes to update the database with the form field values.
here is the error message:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'File'.

/problem_tickets_receipt.asp, line 177

here is the code updating the database line 177 will be outlined:
'output user info to database
Dim objRS_EnterUser
Set objRS_EnterUser = Server.CreateObject("ADODB.Recordset")
objRS_EnterUser.Open "tickets",objConnHD, ,adLockOptimistic, adCmdTable
objRS_EnterUser.AddNew
objRS_EnterUser("user_fname") = formatData_user_fname
objRS_EnterUser("user_lname") = formatData_user_lnam
objRS_EnterUser("wireless_number") = formatData_user_wireless
objRS_EnterUser("urgency") = urgen
objRS_EnterUser("case_type") = c_type
objRS_EnterUser("problem_description") = formatData_prob
objRS_EnterUser("detailed_description") = formatData_detailed
objRS_EnterUser("submitter_userID") = strSession_UID
objRS_EnterUser("entry_date_time") = day_time
objRS_EnterUser("update_date_time") = day_time
if upl.IsEmpty Then
else
objRS_EnterUser("File") = Mid(fileup, 11) <-----LINE 177
end if
objRS_EnterUser.Update

objRS_EnterUser.Close
Set objRS_EnterUser = Nothing

any ideas? im totally stuck i see no syntax error.
 
File may be a reserved word. I'm not sure about this, but I think you should try....

objRS_EnterUser("[File]") = Mid(fileup, 11)


-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
never thought about that because it was included in quotes to denote a string value. im going to give it a try real quick
 
If by chance fileup contains a single quote you may try this:
objRS_EnterUser("File") = Replace(Mid(fileup, 11), [tt]"'", "''"[/tt])

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
That worked but now im trying to figure out why i get this error. ive changed every instance of the name file but still get :

ADODB.Recordset error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.

/problem_tickets_receipt.asp, line 175

what would cause this. i may try phv option reeal quick
 
i figured out what im going to do. use access for this database update and then link the table to sql. much easier and more sercure right?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top