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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

server connection

Status
Not open for further replies.

malola123

Technical User
Feb 16, 2007
17
CA
Hi,

I am creating a page where i need to include a table from a sql database. So i connected to the server and entered my query. However, when I open up the corresponding web page, I receive an error that states that the table name does not match with the table name used in the query. However, I re-checked and ensured that I entered the correct table name and correct fields. I still get the error though.

The table name is T_C_Activity_Types

Here is the code:

"
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open = ConnectionString("IS")

DB = Request.QueryString("DB")
returnField = Request.QueryString("returnField")

stmt = "SELECT T_C_Activity_Types.id, T_C_Activity_Types.ActivityType" &_
"FROM T_C_Activity_Types" &_
"ORDER BY T_C_Activity_Types.id"

'Response.Write stmt

Set oRs = oConn.Execute(stmt)

%>

<body style="margin:0px">
<form name="form1">
<table style="width:100%">
<tr>
<th colspan=4>Activity Type Table
<tr>
<th colspan=4><input class="mainButton" type="button" value="Done" onclick="window.close();">
<input type="hidden" value="<%= returnField %>" name="returnField">

<tr class='rowHeader'>
<th>ID
<th>Activity Type
<%
Dim rowNum
rowNum = 0
WHILE NOT oRs.EOF

Response.Write "<td>"& oRs("id")
Response.Write "<td>"& oRs("ActivityType")

'rowNum = (rowNum + 1) Mod 2
oRs.MoveNext
WEND



%>
"

Can someone let me know what the problem is?...Thx
 
I wonder about the following:
oConn.Open = ConnectionString("IS")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top