Not Connecting to ODBC

Results 1 to 2 of 2

Thread: Not Connecting to ODBC

  1. #1
    Join Date
    Dec 1969

    Default Not Connecting to ODBC

    Hello,<BR>I am getting this error "Document contains no data". I am having problems connecting to my ODBC Driver. Please help. This is what I have..........<BR><BR>&#060;!--#include file = "globals.asp"--&#062;<BR>&#060;%<BR>&#039OPEN DATABASE CONNECTION<BR>MYDSN="dsn=" & dbName & ";" & "UID=" & dbUser & ";" & "PWD=" & dbPass & ";"<BR>set DbObj=server.createobject("ADODB.connection")<BR>D MYDSN<BR>%&#062;<BR><BR>My globals.asp file looks like this..........<BR>&#060;%<BR>&#039Creates connection variables for database<BR>dbName = "Controller"<BR>dbUser = ""<BR>dbPass = ""<BR>%&#062;<BR><BR>I am getting a migrane, PLEASE HELP!!! Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Not Connecting to ODBC

    There are a ton of ways to create a database connection. This is an example of a way that always works for me.<BR><BR><BR>Set DBConn1 = Server.CreateObject("ADODB.Connection")<BR>Set rst1 = Server.CreateObject("ADODB.Recordset")<BR>DBConn1. Open "DRIVER=SQL Server;SERVER=IntranetX;UID=sa;APP=Microsoft Development Environment;WSID=MMSCWS04;DATABASE=Manheim;User Id=sa;PASSWORD=;"<BR>rst1.Open "Select Region, Initial, ID, Auction_Name, Peer, TechMgr from AuctionData where Region =" & Request("Region") & "Order by Auction_Name",DBConn1,2,2<BR>

Posting Permissions

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