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

Help with This Code

Status
Not open for further replies.

jjmew

Programmer
Aug 20, 2002
34
US
I am trying to access a table and the fetch returns false. I test the sql and is working. The table has a lots of rows that should been returned. There is not any connection error, I already check it. Please help me

Dim conn as AcOracleConnection 'AcDBConnection
Dim stmt as AcDBStatement
Dim cursor as AcDBCursor
Dim Row as Tablebrowser 'table browse is a class that has the structure need to read the row from the database

Set conn = new OracleConnection
conn.connect()
Dim s as string
s="select * from common.byu_report_q"
if conn.isConnected() then
Set stmt = conn.prepare(s)
end if

dim a as String

if stmt is nothing then
a = conn.getSpecificErrorText()
end if

Set cursor = stmt.allocateCursor()

Cursor.BindColumn(2,"NewReportApp::TableBrowser","Text")
Cursor.BindColumn(1,"NewReportApp::TableBrowser","TextType")
Dim i as Integer
i=0

Do while true
Set Row = new Persistent NewReportApp::TableBrowser

if not cursor.fetch(row) then
a = conn.getSpecificErrorText()
exit do
End if
i=i+1

headers.setAt(i,row)

Loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top