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

Accessing Oracle DB link table thro MS Access 'DLookup'

Status
Not open for further replies.

Teky1029

Programmer
Aug 21, 2008
3
US
Hi

I've an application written in MS Access code. One of the table ("Member") moved from Access to Oracle database. I've created Database link to access this table. The exisiting function DLookup is giving me runtime error when I try to access this table data. Attached below sample code:
getCnt = DLookup("count (*)", "Member", "c_txt='tIss' and [P_NO]='" & G_PNO & "' and C_dt='" & G_Dt & "' and P_txt='" & G_Prod & "'")

Can you please let me know how to resolve this issue?
 
It's a Run-time error '2001': and then it goes into "Debug" mode.
 
Did you mean Dcount or Dlookup?

getCnt = Dcount("*", "Member", "c_txt='tIss' and [P_NO]='" & G_PNO & "' and C_dt='" & G_Dt & "' and P_txt='" & G_Prod & "'")

 
I'm using "Dlookup" function but even if I tried to use "DCount", a runtime error comes and it puts me in "Debug" mode.

P.S. The ORACLE table name is different than the DB link table name created in MS Access.

Thanks
Prashant.
 
If you are using DlookUp, you must look up something, not:

DLookup("count (*)",

Try:
DLookup("c_txt", "Member", "c_txt='tIss' and [P_NO]='" & G_PNO & "' and C_dt='" & G_Dt & "' and P_txt='" & G_Prod & "'")

As far as I know, you should use the access name.

What error do you get with DCount?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top