Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to connect to SQL from ASP??

Status
Not open for further replies.

FloridaHawk

Programmer
Jun 20, 2003
19
0
0
US
I have had problems with my logon scripts in the example aps pages provided by Crystal Decisions. Getting error on the server in attempting to access the data source. Heres the string I use:

userid = "YOUR_DATABASE_USERID"
password = "YOUR_DATABASE_PASSWORD"

session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False
' Set the location
set crtable = session("oRpt").Database.Tables.Item(1)
crtable.SetLogonInfo "Automation", "pubs", cstr(userid), cstr(password)
 
hi
error are you getting
the code looks good

cheers

pgtek
 
hi

<%@ LANGUAGE=&quot;VBSCRIPT&quot; %>
<title>Crystal Reports ASP Example - Using Set Logon Info</title>

<%Response.Buffer=True%>

<%
reportname = &quot;SimpleSetLogonInfo.rpt&quot;
%>

<!-- #include file=&quot;AlwaysRequiredSteps.asp&quot; -->
<%

set Conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Conn.Open &quot;Provider=SQLOLEDB;Persist Security Info=False;User ID=sa;Password=prymak;Data Source=LEGOLAS&quot;


session(&quot;oRpt&quot;).MorePrintEngineErrorMessages = False
session(&quot;oRpt&quot;).EnableParameterPrompting = False

' Set the location

Set CRXTables = session(&quot;oRpt&quot;).Database.Tables
Set CRXTable = CRXTables.Item(1)
CRXTable.SetLogonInfo &quot;LEGOLAS&quot;, &quot;pubs&quot;, &quot;sa&quot;, &quot;prymak&quot;

%>
<!-- #include file=&quot;MoreRequiredSteps.asp&quot; -->
<%


%>
<!-- #include file=&quot;SmartViewerActiveX.asp&quot; -->
<%


%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top