PDA

View Full Version : What should I change if convert the db from access to excel.


cs168
08-31-2006, 06:12 PM
I try not to use access as databse and want to change it to excel can expert pls let me know what and which part should I change in the code

<%Dim DBPath, connstring, conn
Session.LCID = 1033
DBPath = "db1.mdb"
'connstring = "PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA SOURCE=" & server.mappath(DBPath) & ";" & "Jet OLEDB:Database Password=welcome"
connstring = "PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA SOURCE=c:\database\db1.mdb;Jet OLEDB:Database Password=welcome"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connstring
%>




SET RS=CreateObject("ADODB.Recordset") 'create a recordset
sql = "select * from tblUsers where Username = '" & request("username") & "'"
RS.Open sql,conn,1,3
if rs.eof then
rs.addnew
rs("Username") = request("Username")
rs("Password") = request("Password")
rs("Status") = 1
rs("Authority") = request("authority")
rs.update
else
sMsg = request("username") & " is already a user in the database."
response.write (sMsg)
end if
set rs = nothing
else


my excel file name is user.xls
sheet 1 column a=username, b= password and c= authority


tks

Spudhead
09-01-2006, 12:00 PM
http://www.codingforums.com/showthread.php?t=93929

Any use?