You really don't need the DSN. Using a DSN, a person will have to set up
the DSN on every workstation that is using the program. This is a pain.
Further, if something changes, a person has to make changes on all the
This sample works well.
Public Const gstrConnect As String =
Set adoconn = New ADODB.Connection
.Provider = "SQLOLEDB"
.CommandTimeout = 90
.ConnectionString = gstrConnect
.ConnectionTimeout = 90
.CursorLocation = adUseServer
.Mode = adModeReadWrite
strCmd = "Truncate Table MainUser"
adoconn.Execute strCmd, , adCmdText And adExecuteNoRecords
> First, the physical location of the *.mdf file does not matter. The db
> is propably called Data on the SQL server? Simply create an ODBC
> system DSN to the database. (Depending on what OS you are using , try
> control panel first, use the SQL Driver) You then talk to the db like
> Set Conn = Server.CreateObject("ADODB.Connection")
> temp = "Provider=SQLOLEDB;SERVER=<servername>;UID=<user id for sql
> server>;DATABASE=<the db you want to use>;UserId=<user
> id>;password=<the password for sql>"
> conn.open temp
> theDSN="DSN=<name of the system DSN>"
> > I have a SQL Server Database at say H:\Databases\Data.mdf
> > With Table People
> > I want a Visual Interdev page (asp) that will accept a person's name
> > store it in the Table People.
> > If someone could show me how to do something simple like this then I
> > take off and learn a lot more. I just want a helping hand getting
> > Or feel free to show me another example.
> > Take out the _no_more_ to email me.
> > Thanks in advance for any push someone is willing to give me.
> > BTW the web page would be on drive G. Yes - I own my own server. I
> > under the impression the best way to learn is to do everything,
> > hosting your own server. So, I am learning lots of things, I just
> need some
> > pushes.
> > Thanks,
> > Markis
> Sent via Deja.com http://www.deja.com/
> Before you buy.