Subj: error on ODBC query Section: Queries/SQL To: clmorar, 73602,2711 Thursday, September 25, 1997 6:39:05 PM From: Calvin Smith, 102226,2127 #695565 >>> Thanks for responding. <<< You're welcome! :-) >>> I will do reading regarding API Fuctions in ODBC.DLL According to A2 Developers Handbook the online help in VB Professional edition is a good resource. Any others? <<< Hmmm, I'm not sure what Ken and the other authors were referring to in their book but, the "Hitchhiker's Guide to Visual Basic & SQL Server" (Fifth Edition) is a *REAL* winner. (Damn good job Bill, if you're out there following this thread) Maybe Ken and those guys were reffering to VB Pro On-line books, which does have *very* useful information on this subject. But, if you saw that in their A2 book, then they're referring to something different. I'm referring to VB5 On-line books, which wasn't available when that book was printed. >>> I'm trying to learn to use pass through queries. Can you tell me if it's possible to use an auxillary local table to bring in, say department names, joined to the server table on DEPT_NO using a pass through. Since I just begun this learning process, I think the error said "unable to locate this auxillary table. <<< You should be able to based on your available DAO tools. e.g. (VB/Access 32-bit) Dim conMyConnection As Connection Dim rsMyLocalTable As RecordSet Dim rsMyQueryDefResults As RecordSet Dim strSQL$ Dim qdfMyPassThruQueryDef As QueryDef Set conMyConnection = OpenConnection(blah, blah, blah) strSQL$ = "Create proc GetDeptNamesFrom" & _ " (@dept_num char(5))" & _ " as" & _ " select dept_name from depts" & _ " where dept_num = @dept_num" conMyConnection.Execute strSQL$ Set qdfMyPassThruQueryDef = conMyConnection.CreateQueryDef("qryMyWorkingQuery", _ "{call GetDeptNamesFrom (?)}") qdfMyPassThruQueryDef.Parameters(0) = "A5000" '<-Your DEPT_NO qdfMyPassThruQueryDef.Parameters(0).Direction = dbParamInput Set rsMyQueryDefResults = qdfMyPassThruQueryDef.OpenRecordSet() While Not rsMyQueryDefResults.EOF ' *** populate rsMyLocalTable here *** Wend ...or something like that. >>> Also, how does one use user-defined functions to speed up the processing? I'm wondering if the procedure(s) are simply added to the QBE grid on an aliased field or is it done with code and DAO's? <<< Hopefully, the above sample also answers this question. Calvin Smith - Sr. Visual Basic/MS Access Consultant ******************************************************** WEB: http://www.CalvinSmithSoftware.com ******************************************************** ------------------------------------------------------------------------------- Subj: error on ODBC query Section: Queries/SQL To: clmorar, 73602,2711 Friday, September 26, 1997 8:36:45 PM From: Calvin Smith, 102226,2127 #695762 >>> Thanks...that was a great response! <<< You're welcome! :-) >>> Another response I received on this subject indicated that both tables needed to be on the server, in order to use passthroughs. There appears to be a contradiction. <<< Well around here, we all have different ideas/approaches about how to get things done . I tend to be bias toward my own coding style/solutions. >>> Is there a peformance betterment if the code was done in 16bit VB4 or is it the same as VBA in Access2? <<< I really don't know the answer to that question, but I would assume that VB4 has the edge, if any difference at all. I could be wrong. Calvin Smith - Sr. Visual Basic/MS Access Consultant ******************************************************** WEB: http://www.CalvinSmithSoftware.com ********************************************************