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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unable to insert in database once site is uploaded 2

Status
Not open for further replies.

goaganesha

Programmer
Dec 4, 2001
178
BE
Hi there,

I've made a website which works fine at home. Once I upload it to the remote server, only the pages with an sql select statement open fine, once I try to insert something in the database, I get an internal servererror 500.
I tried using the insert into... sql statement and de recordset "addnew " function but both fail. Does anyone know what could be going wrong since everything works fine at my own pc.

Could it have something to do with the fact that I'm not using a dsn to connect to the database, but a relative path??
Here is the code:
<%Option Explicit

Dim strConnect, accessdb
accessdb=server.mappath(&quot;resume.mdb&quot;)
strConnect =&quot;Provider=Microsoft.Jet.OLEDB.4.0;&quot; &_
&quot;Jet OLEDB:Database Password=test;&quot; &_
&quot;Data Source=&quot;&accessdb&&quot;;&quot; &_
&quot;Persist Security Info=False&quot; %>



<% Dim RS, Conn, query
Set Conn= Server.CreateObject(&quot;ADODB.Connection&quot;)
Set RS = Server.CreateObject(&quot;ADODB.Recordset&quot;)
query = &quot;SELECT * FROM user&quot;
Conn.open strConnect
RS.open query,Conn,1,3
RS.AddNew
RS(&quot;userID&quot;)= 20
RS(&quot;type&quot;)=&quot;test&quot;
RS(&quot;knowledge&quot;)=&quot;test&quot;
RS.update
RS.close
set RS = nothing
Conn.close
set Conn = nothing

%>

regards, goaganesha
 
W.A.G...

Perhaps a permissions issue on the server?
Tom Gahagan
tgahagan@charter.net

REST



If you get a chance to sit out or dance...

I hope you dance. L Wommack
 
Thanks for your help,
Would using a dsn solve this problem or should ask my hosting company for write permissions?

The ADO constants file is available 'cause I include it in some pages that work fine.

regards ,goaganesha

 
>> accessdb=server.mappath(&quot;resume.mdb&quot;)

when you write to an Access database the Jet engine creates a temporary file with a .lst extension (don't know what is in there). Therefore the WEB_USER account needs to have &quot;write&quot; permissions to that &quot;folder&quot;.

hope that helps
-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top