Jumat, 11 Desember 2015

RE: [MS_AccessPros] OpenRecordset Method Name Argument String Breaks At 1024 Characters

 

Darrell,
 
Can you share your code and/or the SQL statement? Have you tried using Debug.Print to capture and display your SQL statement? (Hint: most of us veteran coders do this consistently).
 
I always use line continuation to keep all of my code visible without scrolling.
 
Duane Hookom, MVP
MS Access
 

To: MS_Access_Professionals@yahoogroups.com
From: MS_Access_Professionals@yahoogroups.com
Date: Fri, 11 Dec 2015 12:42:31 -0800
Subject: [MS_AccessPros] OpenRecordset Method Name Argument String Breaks At 1024 Characters



Greetings All,


I'm trying to perform an OpenRecordset method using a string variable for the SQL. The procedure throws an error for Invalid procedure call or argument. When I view the generated string, it is broken into two lines. The first line contains 1024 characters and breaks in the middle of the word JOIN. The total length of the SQL string is 1100 characters.


I've Tried breaking the SQL into three strings for the Select, From, and Where clauses and then concatenating the three variables for the OpenRecordset Name argument. The result is the same.


Also, I have an error handler in the procedure but, I still get the error dialog box instead of my custom error MsgBox. Yes, I checked the options to ensure the Error Trapping option was not set to Break on All Errors. It is set to Break on Unhadled Errors.


Has anyone experienced this behavior?




Darrell


__._,_.___

Posted by: Duane Hookom <duanehookom@hotmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar