PDA

Click to See Complete Forum and Search --> : ODBC problem


R@emdonck
Dec 16th, 1999, 05:26 PM
Hi,

Private Sub stored_procedure_ODBC()


Dim str_SQL, Connect$, int_teller, db_data, rs_data


str_SQL = "select * from dbo.vj_bc1_gft_prp_001"


Connect$ = "ODBC;DSN=global;UID=report;PWD=report;DATABASE=global;"
Set db_data = OpenDatabase("GLOBAL", False, False, Connect$)
Set rs_data = db_data.OpenRecordset(str_SQL, dbOpenDynaset, dbSeeChanges)


rs_data.MoveLast
int_teller = rs_data.RecordCount

MsgBox int_teller


End Sub

this code gives me a problem !! In the SQL statement (the name of the table) there is a dot. (dbo DOT vj_bc1_gft_prp_001) and for that the code doesn't work!! RUN TIME ERROR 3024 Couldn't find file 'C:\...\dbo.mdb'

Who can fix this ??


R@emdonck

Ishamel
Dec 16th, 1999, 05:51 PM
Try removing the dbo. from your SQL statement.

I tried it on an SQL Server database and it worked fine.

Hope it works. :)

------------------
Ishamel
KBurt59082@AOL.COM

R@emdonck
Dec 16th, 1999, 06:19 PM
Hi,

No, it does not work. I get an ODBC failure.

Sorry

R@emdonck

Ishamel
Dec 16th, 1999, 08:34 PM
Try replacing this


Set db_data = OpenDatabase("GLOBAL", False, False, Connect$)


with this


Set db_data = OpenDatabase("", False, False, Connect$)