SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 4th, 2001, 07:54 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
SQL/ASP on local machine error on connect

<i><b>Originally posted by : Pier (p.bover@behindthepixel.com)</b></i><br />I'm trying to connect an asp page that is in my computer into an SQL database that is also on my copmputer. <br /><br />I've got installed PWS so the ASP code works perfectly, but when I try connect to the db I get an error message that says there's an sql error because the connection is not "sure" (I have the sapnish version of sql manager). So the error comes when the authentification. <br /><br />I have created a new user in the SQL manager for this purpose but it gives me the same error. I have tried also with "sa" as the User ID but I get the same message. <br /><br />I'm trying to connect without a DSN, but I have also tried with DSN and I get the same thing. <br /><br />Anyone can help me? <br /><br />Thanks <br /><br />Pier

Reply With Quote
  #2  
Old August 28th, 2001, 05:18 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : HeatherP (vge009@aol.com)</b></i><br /><br /><br /><br />------------<br />HeatherP 8/28/01<br />This is the only way I know how, hope this helps<br />Create a seperate file, Name it DatabaseConnect.asp then cut and paste this code<br />(NOTE!!!DatabaseConnect.asp must be in the same folder as the asp file!><br /><%<br />'This listing is a DSN-Less Connection going to access database <br />Dim objConn<br />Set objConn = Server.CreateObject("ADODB.Connection")<br />objConn.ConnectionString="Driver={Microsoft Access Driver (*.mdb)};" & "DBQ=C:My DocumentsYourFolderYourDatabase.mdb"<br />objConn.Open<br />%><br /><br />Then in the begining of your asp file use this code<br /><br /><%@ Language=VBScript %><br /><% Option Explicit %><br /><!--#include File="DatabaseConnect.asp"--><br /><!--#include virtual="/adovbs.inc"--><br /><HTML><br /><BODY><br /><%<br />Dim strSQL<br />strSQL = "SELECT Column1, Column2, Column3, FROM tblColumn ORDER BY Price DESC"<br /><br />'Create a recordset object instance, and execute the SQL Statement<br />Dim objRS<br />Set objRS = Server.CreateObject("ADODB.Recordset")<br />objRS.Open strSQL, objConn<br /><br />'We are displaying the Columns by price<br />%><Align="CENTER"><br /><B><font size="10">A Listing of Columns:</Font></B><br /><div align="center"><br /> <center><br /><TABLE border=1 cellpadding=3 cellspacing="3"><br /><TR><TD align="center"><B>Column 1</TD><br /><TD align="center"><B>Column 2</TD><br /><TD align="center"><B>Column 3</TD></TR><br /><%<br />Do While Not objRS.EOF<br />Response.Write "<TR><TD><FONT FACE=Arial>" & objRS("Column1") & "</TD>"<br />Response.Write "<TD><FONT FACE=Arial>" & objRS("Column2") & "</TD>"<br />Response.Write "<TD><FONT FACE=Arial>" & objRS("Column3") & "</TD></TR><BR>"<br />'Move on to the next line(row)<br />objRS.MoveNext<br />Loop<br /><br />'Clean up our ADO objects<br />objRS.Close<br />Set objRS = Nothing<br /><br />objConn.Close<br />Set objConn = Nothing<br />%><br /></TABLE><br /></BODY><br /></HTML><br /><br />Granted you will need to fill in the blanks but I hope this helps!<br />

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > SQL/ASP on local machine error on connect


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway