Did this article resolve your question/issue?



Sample ASP Program to access Progress Database via SQL-92 Engine

« Go Back


TitleSample ASP Program to access Progress Database via SQL-92 Engine
URL Name20158
Article Number000173340
EnvironmentProgress 9.1x
Question/Problem Description
How to access Progress SQL-92 via a sample Microsoft Active Server Pages program.
How to access a Progress database via ASP?
Sample ASP pages to access Progress database via SQL-92
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
The connection is done via ODBC. It uses a System data source name (DSN). User name and password should be specified to in the connection.

The program assumes that there is a sports2000 database running on your local system using port 2500 which is specified in the DSN. Also, the example uses user "dba1" with a password of "password" entered at the connection string.
The following code uses the ASP statement On Error Resume in order to handle ODBC error and warning messages at the program level. The On Error statement can be used to avoid the display of the following ODBC warning messages:

- [MERANT][ODBC PROGRESS driver]Optional feature not implemented.

- [MERANT][ODBC PROGRESS driver]Driver's.
The program provides a variable called mydebug and the procedure
DisplayODBCErrors to display the errors if the variable is set to true.

The program:

<title>Sample ASP Page Using Progress SQL-92 database</title>

Time: <%=now%><br>

On Error Resume Next
Dim mydebug
   mydebug = false

' DSN defined as db=sports2000;host=localhost;port=2500

myDSN = "dsn=p91a;uid=dba1;pwd=password"
mySQL = "select custnum, creditlimit from pub.""customer"""

set conntemp = server.createobject("adodb.connection") myDSN

response.write "Err.Number = "
response.write (Err.Number)
response.write " Conntemp.Errors.Count = "
response.write (conntemp.Errors.Count)



<table border="2">
set rstemp = conntemp.execute(mySQL)


if rstemp.eof then
  response.write "No record matched<br>"
  set conntemp = nothing
end if

do until rstemp.eof %>
  <tr><td> <%=rstemp(0) %> </td><td><%=rstemp(1) %> </td><td>
<%=rstemp(2) %> </td></tr>


set rstemp = nothing


set conntemp = nothing

<% Function DisplayODBCErrors() %>
<% if mydebug and (conntemp.Errors.Count > 0) then %>
<br><br><b>ODBC Connection Error and Warning Messages</b><br>
<% For intLoop = 0 To conntemp.Errors.Count - 1 %>

Error No: <%= conntemp.Errors(intLoop).Number %><BR>
Description: <%= conntemp.Errors(intLoop).Description %><BR>
Source: <%= conntemp.Errors(intLoop).Source %><BR>
SQLState: <%= conntemp.Errors(intLoop).SQLState %><BR>
NativeError: <%= conntemp.Errors(intLoop).NativeError %><P>

<% Next %>
<% end if %>
<% End Function %>


References to Written Documentation:

Progress SQL-92 Guide and Reference

Progress ODBC Driver Guide
NOTE: The Progress WebSpeed product can be used to web-enable applications or to develop web applications accessing Progress databases or Progress DataServer databases.

The Progress approach is scalable, portable, connects natively, and allows deployment of compiled code among other features.
Last Modified Date9/14/2015 6:53 AM
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.