Skip to main content
New Participant
August 27, 2007
Question

Connecting Informix Database with ASP

  • August 27, 2007
  • 1 reply
  • 1258 views
Dear all,

In the last days, I am trying to connect to my Informix DB with ASP. I am using Adobe Dreamweaver CS3. For this reason, I installed Informix ODBC Driver connect.2.90.TC6.WIN in our Server, which is the Web Server of my Web Site. Furthermore, I added the following rows:

1. in hosts file: 172.25.30.20 cwm2 (Name of the Informix Server).
2. in services file: atm_service 33179/tcp (the service, which communicates with Informix Server).

I created a Data Source (with name=atm) in Web Server with successfull connection with Informix DB.

Furthermore, I created 2 asp pages, which have the following code:

db.asp

<%
xDb_Conn_Str = "Provider=Ifxoledbc.2;password=<pwd>;User ID=<user name>;Data Source=<Informix Database name>@<Informix Server name=cwm2>;Persist Security Info=true;"

xDb_Conn_Str_Ora_Blob = "Provider=Ifxoledbc.2;password=<pwd>;User ID=<user name>;Data Source=<Informix Database name>@<Informix Server name=cwm2>;Persist Security Info=true;"
%>

test.asp

<%@ CodePage = 28597 LCID = 1032 %>
<%
Response.expires = 0
Response.expiresabsolute = Now() - 1
Response.addHeader "pragma", "no-cache"
Response.addHeader "cache-control", "private"
Response.CacheControl = "no-cache"
%>
<%
<!-- Initialise -->
ewCurSec = 0
<!-- User levels -->
Const ewAllowAdd = 1
Const ewAllowDelete = 2
Const ewAllowEdit = 4
Const ewAllowView = 8
Const ewAllowList = 8
Const ewAllowReport = 8
Const ewAllowSearch = 8
Const ewAllowAdmin = 16
%>

<!--#include file="include/db.asp"-->

<%

<!-- Open connection to the database -->
Set conn=Server.CreateObject("ADODB.Connection")

conn.ConnectionString = xDb_Conn_Str
conn.Open

<!-- Build SQL -->

sSql = "SELECT count(*) FROM svplus_card;"

Response.Write sSql

' Set up Record Set
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = 3
rs.Open sSql, conn, 1, 2

Response.Write rs.RecordCount

%>

Unfortunately, I cannot connect with Informix DB and I get the following error:

error '80040e14'

I wonder if you could help us.

Thank you very much.

Giorgos Baliotis (gbaliotis@cosmote.gr)
This topic has been closed for replies.

1 reply

Inspiring
August 27, 2007
www.connectionstrings.com


"gbaliotis" <webforumsuser@macromedia.com> wrote in message
news:faup0h$3f9$1@forums.macromedia.com...
> Dear all,
>
> In the last days, I am trying to connect to my Informix DB with ASP. I am
> using Adobe Dreamweaver CS3. For this reason, I installed Informix ODBC
> Driver
> connect.2.90.TC6.WIN in our Server, which is the Web Server of my Web
> Site.
> Furthermore, I added the following rows:
>
> 1. in hosts file: 172.25.30.20 cwm2 (Name of the Informix Server).
> 2. in services file: atm_service 33179/tcp (the service, which
> communicates
> with Informix Server).
>
> I created a Data Source (with name=atm) in Web Server with successfull
> connection with Informix DB.
>
> Furthermore, I created 2 asp pages, which have the following code:
>
> db.asp
>
> <%
> xDb_Conn_Str = "Provider=Ifxoledbc.2;password=<pwd>;User ID=<user
> name>;Data
> Source=<Informix Database name>@<Informix Server name=cwm2>;Persist
> Security
> Info=true;"
>
> xDb_Conn_Str_Ora_Blob = "Provider=Ifxoledbc.2;password=<pwd>;User ID=<user
> name>;Data Source=<Informix Database name>@<Informix Server
> name=cwm2>;Persist
> Security Info=true;"
> %>
>
> test.asp
>
> <%@ CodePage = 28597 LCID = 1032 %>
> <%
> Response.expires = 0
> Response.expiresabsolute = Now() - 1
> Response.addHeader "pragma", "no-cache"
> Response.addHeader "cache-control", "private"
> Response.CacheControl = "no-cache"
> %>
> <%
> <!-- Initialise -->
> ewCurSec = 0
> <!-- User levels -->
> Const ewAllowAdd = 1
> Const ewAllowDelete = 2
> Const ewAllowEdit = 4
> Const ewAllowView = 8
> Const ewAllowList = 8
> Const ewAllowReport = 8
> Const ewAllowSearch = 8
> Const ewAllowAdmin = 16
> %>
>
> <!--#include file="include/db.asp"-->
>
> <%
>
> <!-- Open connection to the database -->
> Set conn=Server.CreateObject("ADODB.Connection")
>
> conn.ConnectionString = xDb_Conn_Str
> conn.Open
>
> <!-- Build SQL -->
>
> sSql = "SELECT count(*) FROM svplus_card;"
>
> Response.Write sSql
>
> ' Set up Record Set
> Set rs = Server.CreateObject("ADODB.Recordset")
> rs.CursorLocation = 3
> rs.Open sSql, conn, 1, 2
>
> Response.Write rs.RecordCount
>
> %>
>
> Unfortunately, I cannot connect with Informix DB and I get the following
> error:
>
> error '80040e14'
>
> I wonder if you could help us.
>
> Thank you very much.
>
> Giorgos Baliotis (gbaliotis@cosmote.gr)
>


gbaliotisAuthor
New Participant
August 28, 2007
I have seen this site: www.connectionstrings.com and unfortunately I cannot solve my problem.

I would be very grateful if you could give me some steps, in order to succeed this connection (Informix - ASP).

1. Is there any problem with a connection of ASP and Informix generally?
2. Do I have to state the path where my DSN is located in our Web Server?

Don't forget that our Web Server is a Windows based Server (Win 2000) and our Informix DB is installed in a Solaris Server.

Thank you very much.

Giorgos Baliotis