Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Ynt:Re: ASP database


Message #1 by "willpower"<willpower@m...> on Sun, 8 Dec 2002 13:29:40 +0200
 
Hi...
You should copy your database under this folder:
C:    -->   WINNT   -->   system32
and also under the folder that you use it for execute your asp codes 
C:  -->  inetpub  -->  wwwroot  
 
And you should change it the read-only ..
you should right click on your database and select properties.. you will see there read only- archive and hidden.. you should select
only archive...
 
And this is my code that I use it to insert data in database
 
<%
 
 
set con=Server.CreateObject("ADODB.Connection")
con.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("formdatabase.mdb") & ";User ID=; Password=;"
set rs=Server.CreateObject("ADODB.Recordset")
 
sql="select * from formden where username='" & request.form("username") & "'"
 
set rs=con.execute(sql)
 
if rs.eof=true then
 
insert = "insert into formden 
 
(name,surname,username,pwd,i,month1,day1,year1,region,job,telno,mail,category) values ('" & name & "','" & surname &
"','" & username & "','" & pwd & "','" & i & "','" & month1 & "','" & day1 & "','" &
year1 & "','" & region & "','" & job & "','" & telno & "','" & mail & "','" & category &
"')"
   con.Execute insert
 
 
I hope this can help you
My regards...
   
   
  %>
 
 
 
> At 10:09 ðì 6/12/2002, you wrote: 
> 
> >I am trying to add a record to the access database through ASP page. This 
> >is the exact code from Beginning Active Server Pages 3.0 , chapter 
> >15. But for some reason I am getting an error at 
> >rsUsers.addnew 
> >The error is" Database cannot be updated. Database is read only"If 
> >someone know how to fix it please help me 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >Tired of spam? Get advanced junk mail protection with MSN 8. 
> > 
> >--- 
> 
> 
> 
> --- 
> 


__________________________
Türkiye'nin tercihi! Mynet Email



  Return to Index