|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
database dsn-less
hello,
i have this code that is supposed to help me out in some databse retrieval issue. however i am not aware of the dsn-less code and stuff: <% var rs = Server.CreateObject("ADODB.Recordset"); rs.Open("select * from states","DSN=IST_SQL;UID=....;pwd=...."); var n=0; while (!rs.EOF) { ... } rs.Close(); %> i think the following is also to be included in the above code, but i am not sure of the whole connection thing. conn.open "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=letmein; DBQ=" & Server.MapPath("\db.mdb") & ";" |
|
#2
|
|||
|
|||
|
Connections
3 types/way(there is more but the 3 most used are...) to connect to a database:
--------------------------------- 1) Using an ODBC 2) Using a DSN-Less 3) Using OLEDB --------------------------------- 1) Using an ODBC You must create an ODBC on the machine where your asp pages are. The ODBC *must* point to the SQL Server(for example) or where the database is. 2) Using a DSN-Less This approach uses what we call a *driver* to connect to your database. The great thing about this approach is that *you* the programmer put it in a *string* and that if you decide to change server the only thing you need to change is that *string*. This can be practical assuming your web site is being hosted somewhere in Hong Kong...all you need to do is connect via ftp, retrieve the file that holds that *string* make the change and re-upload the file.. 3) Using OLEDB This approach resembles a lot the 2) one major difference is that it uses a *provider* as opposed to a driver. The other thing is a provider is faster then a driver. Think of it as a native acces to your database. I personally used/prefer the OLEDB approach since it is faster. Now here is a link that *you* must bookmark: http://www.able-consulting.com/ADO_Conn.htm Hope this helps! Sincerely Vlince |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > database dsn-less |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|