Please dont yell at me...

Results 1 to 8 of 8

Thread: Please dont yell at me...

  1. #1

    Default Please dont yell at me...

    ....but I need to convert this connection string so that It points to an SQL server DB. It has a username of SA and a password of SOMETHING.<BR><BR>&#039;Connection string<BR>DIM myconn<BR>Set myconn = Server.CreateObject("ADODB.Connection")<BR>myconn. ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath ("/longlostfriends/database/longlostfriends.mdb") & ";"<BR>myconn.Open<BR><BR>*hides under desk*<BR><BR>John

  2. #2
    Join Date
    Dec 1969

    Default RE: Please dont yell at me...

    Here ya go:<BR><BR>< BR>BTW...You&#039;d better believe that I&#039;m going to yell at you for connecting to SQL Server from a web application using the sa account. Set up a new, limited access account, call it something like WEBUSER, and connect using that instead.

  3. #3

    Default Thanks...

    ..Im just testing using the sa account at this point to get it up and running.<BR><BR>Ill be back if I have any problems.<BR><BR>John

  4. #4

    Default named instance?

    I dont believe I have a named I? The only instance is the default...MSSQLSERVER.<BR><BR>oConn.Open "Provider=sqloledb;" & _<BR> <BR>Im unsure here...<BR>"Data Source=myServerNamemyInstanceName;" & _<BR><BR>Its not just a C:inetpublah blah blah is it? Unlike Access. I didnt create a named instance.....<BR><BR>Heres what I have<BR><BR>myconn.Open "Provider=sqloledb;" & _<BR> "Data Source=localhost?
    oidea?;" & _<BR> "Initial Catalog=longlostfriendsSQL;" & _<BR> "User Id=sa;" & _<BR> "Password=something"<BR><BR><BR>Sorry but Im new to SQL SERVER<BR><BR>John

  5. #5

    Default hmmm this works

    Set myconn = Server.CreateObject("ADODB.Connection")<BR>DSNtest ="DRIVER={SQL Server};SERVER=IPSWICH_STAF9;UID=sa;PWD=something; DATABASE=longlostfriendsSQL"<BR> DSNtest<BR><BR>There seems to be a number of ways to do this. Which is best?<BR><BR>John

  6. #6
    Join Date
    Dec 1969

    Default RE: named instance?

    If it&#039;s on the same machine, then one of these:<BR><BR>"Data Source=.;" & _<BR>"Data Source=(local);" & _<BR>"Data Source=MachineNameHere;" & _<BR>"Data Source=MachineIPHere;" & _<BR><BR>should do the trick. Take your pick.

  7. #7
    Join Date
    Dec 1969

    Default That's fine.

    It&#039;s an ODBC connection string, as opposed to the newer OLE-DB.<BR>I don&#039;t know what the perfomance of ODBC vs. OLE-DB is in SQL Server&#039;s case. Personally, I (almost) always use OLE-DB.<BR>

  8. #8

    Default yeah...

    ODBC seems to chug along nicely. Unless I see reason to change it, Ill leave it be.<BR><BR>Apart from that, it looks like ive got some naming issues in some of my tables. Shouldnt be too hard to sort out.<BR><BR>Thanks for your help fellas.<BR><BR>John

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts