Results 1 to 2 of 2

Thread: how do i connect to my sql database ?? whats wrong with my code

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    103

    Unhappy

    using vb scipt
    Code:
    Sub OpenDatabase(ByRef dbConn)
    	Set dbConn = Server.CreateObject("ADODB.Connection")
    	dbConn.ConnectionTimeout = 15
    	dbConn.CommandTimeout = 30
    	dbConn.Open "PWD=sa;DATABASE=bnw"
    what have i done wrong???

    i always get an error when trying access it this way????
    this code comes from my

    code.inc file that i call up on every use that i want to open my SQL7 database ??
    the name of my database is BNW
    my server is nt004
    password for it is sa

    maybe coz i have not included my server nt004 in it??

    how do i do this????



  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    You must specify a provider and a data source

    try this
    dbConn.Open "Provider=SQLOLEDB;Data Source=NT004;UID=UserNameHere;PWD=sa;DATABASE=bnw"

Posting Permissions

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



Click Here to Expand Forum to Full Width