Forum Moderators: open

Message Too Old, No Replies

Opening a database without DSN

Opening access (adodb) database (asp/vbscript)

         

HoMeR

1:55 pm on May 23, 2002 (gmt 0)

10+ Year Member



Hi,

I'me looking for a example, to open a database without using DSN !
And show the table of contents.

I was thinking vbscripting ?

korkus2000

1:55 pm on May 23, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



if it is ms access you can use the jet provider.

this uses the jet 4.0 provider for access:
[asp101.com...]

Microsoft:
[msdn.microsoft.com...]

this is also good:
[learnasp.com...]

Xoc

2:58 pm on May 23, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Against what database? You can specify a connection string that will get you there without a DSN.

HoMeR

4:47 pm on May 23, 2002 (gmt 0)

10+ Year Member



Ime using a Access database, i can get form-values into the database, but cant get displayed.

this is what i do to write to the database;

<%@ Language = "VBScript"%>
<%
dim conn
dim rs
dim strconn
dim strsql

strsql = ""
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("sites.mdb")

' this works , using form input
strSQL = "INSERT INTO sites (title) Values('" & request("title") & "')"

'Set connection object
set conn = server.createobject("adodb.connection")
conn.open strconn
'Use the execute method of the connection object the insert the record
conn.execute(strSQL)
conn.close
set conn = nothing
%>

what should i change to read from the database ? (i dont want to use DNS?)

Xoc

5:05 pm on May 23, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use this as the connection string:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydb.mdb;Persist Security Info=False

HoMeR

6:31 pm on May 23, 2002 (gmt 0)

10+ Year Member



Thanx Korkus & Xoc, i've got a working connection now !! :)

HoMeR

10:57 am on May 24, 2002 (gmt 0)

10+ Year Member



Xoc, what is the exact result/benefit of using;

Persist Security Info=False

Xoc

6:30 pm on May 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Something about how long it saves usernames and passwords that you use to log in, I think.