SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Very Urgent...

  1. #1
    SitePoint Enthusiast Hercules's Avatar
    Join Date
    Jul 2001
    Location
    Beirut - Lebanon
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Very Urgent...

    Hi everybody.

    I'm stuck trying to write asp code to connect to a database in MS SQL Server 7.0, does anybody have a template or sample code or anything that can help.

    I would appreciate and help.

    Thanks

  2. #2
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    heres a dsnless connection

    Code:
    Set objDBCon = Server.CreateObject("ADODB.Connection")
    strConnect = "Driver=SQL Server;Server=NameOfServer" _ 
    ;uid=username;pwd=password;database=DatabaseInServer")
    objDBCon.open strConnect
    if you want to know how to make a dsn connection, lemme know

  3. #3
    SitePoint Member gluefish's Avatar
    Join Date
    Jul 2001
    Location
    Aurora, OR
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Slight correction

    dhtmlgod, I believe I found a quote sign belonging to you in the bit bucket. Here, I'll try to insert it where it belongs:

    Set objDBCon = Server.CreateObject("ADODB.Connection")

    strConnect = "Driver=SQL Server; " _
    & "Server=NameOfServer; " _
    & "uid=username; " _
    & "pwd=password; " _
    & "database=DatabaseInServer")

    objDBCon.open strConnect

    Pardon the style difference. But you were missing a quote mark that could have made some difference to the user.

    The Gluefish
    I'd rather have a free bottle in front of me than a prefrontal lobotomy

  4. #4
    SitePoint Wizard wdmny's Avatar
    Join Date
    Jul 2000
    Location
    Here
    Posts
    1,010
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check the "iissamples" directory under "inetpub\wwwroot". There, under "sdk\asp", is ASP code to do about anything. Each sub folder has several examples in both VBScript and JScript. You should find how to do anything you would need in the "Database" folder. So that full path would probably be "c:\inetpub\wwwroot\iissamples\sdk\asp\database", if I am not mistaken.


Bookmarks

Posting Permissions

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