Unix Technical Forum

("ADODB.RecordSet") access problem

This is a discussion on ("ADODB.RecordSet") access problem within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> Set Conn=Server.CreateObject("ADODB.Connection") Set rs=Server.CreateObject("ADODB.RecordSet") Conn.Open CU_DSN rs.Open "SELECT * FROM tbl_AddrChange WHERE ID=" & szID & " AND CUNumber=" ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 08:44 PM
=?Utf-8?B?V2VuZHkgRWxpemFiZXRo?=
 
Posts: n/a
Default ("ADODB.RecordSet") access problem

Set Conn=Server.CreateObject("ADODB.Connection")
Set rs=Server.CreateObject("ADODB.RecordSet")
Conn.Open CU_DSN
rs.Open "SELECT * FROM tbl_AddrChange WHERE ID=" & szID & " AND

CUNumber=" & CheckString(Session("CUNumber"),""),Conn

FUNCTION CheckString (s, endchar)
pos = InStr(s, "'")
While pos > 0
s = Mid(s, 1, pos) & "'" & Mid(s, pos + 1)
pos = InStr(pos + 2, s, "'")
Wend
CheckString="'" & s & "'" & endchar
END FUNCTION
I am working with the following code:

Set Conn=Server.CreateObject("ADODB.Connection")
Set rs=Server.CreateObject("ADODB.RecordSet")
Conn.Open CU_DSN
rs.Open "SELECT * FROM tbl_AddrChange WHERE ID=" & szID & " AND

CUNumber=" & CheckString(Session("CUNumber"),""),Conn

FUNCTION CheckString (s, endchar)
pos = InStr(s, "'")
While pos > 0
s = Mid(s, 1, pos) & "'" & Mid(s, pos + 1)
pos = InStr(pos + 2, s, "'")
Wend
CheckString="'" & s & "'" & endchar
END FUNCTION

The following line of code is having a problem:
"rs.Open "SELECT * FROM tbl_AddrChange WHERE ID=" & szID & " AND
CUNumber=" & CheckString(Session("CUNumber"),""),Conn"

This is code is for a server program that uses classic asp (vbscript).

A sql server 2000 databaase is used in the applcation. The above line

of code does select the correct row in the sql server 2000 table and

all the columns are selected. However,
all the values from the table is not selected. A few columns obtain

their values but the rest of the columns from the sql server 2000 table

are not obtained.
I have been trying to solve this problem for awhile. Thus, can you tell

me what could cause some rows to not be selected.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:57 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com