PDA

View Full Version : wierd. connection strings


ShMiL
10-17-2005, 01:12 PM
conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=C:\****mn.mdb;Persist Security Info=False"

conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("../****mn.mdb") & ";Persist Security Info=False"


the second one allows me to grab a new auto-number field created ater an rs.update, and the firest conn NOT.

the code is:

rs.open "clients",conn,3,3
rs.AddNew
rs("***") = ***
rs.Update
nid=rs("id")
rs.close
set rs=nothing


The problem, nid contains nothing, instead of containing the new [id] value.

How is that?

Thanks

Bullschmidt
10-17-2005, 11:10 PM
Well I've always heard that the Jet connection is much better to use as it is supposed to be more efficient and robust.

ShMiL
10-18-2005, 12:13 AM
is there a way to stay with the jet and insert physical path?

Bullschmidt
10-18-2005, 02:07 AM
Sure just change this:

conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("../****mn.mdb") & ";Persist Security Info=False"

To be this instead:

conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\****mn.mdb;Persist Security Info=False"

ShMiL
10-18-2005, 12:43 PM
works fine :thumbsup: