|
-
Apr 13th, 2023, 12:31 PM
#12
Thread Starter
Fanatic Member
Re: Query returns value from wrong column of the table
Shaggy/Option
Both of you appear to be focused on the overall, messiness if you will, of the code in in both the calling query and MasterBaseQuery().
First, DataSet. I used to use datasets for all of my data but long ago quit using them, except for comboboxes. So does using the DataSet interfere with any of the elements of MasterBasseQuery() that do not use a DataSet? There are no comboboxes used on the form staffRecord.vb. I REM'd out any reference to DataSet from MasterBaseQuery() and the ListCommand line was identical to what it was before.
Global Variables. I use them because I don't know a better approach.
Parameters. I use parameters with many of the functions that use MasterBaseQuery(). Without actually looking through all of my calling functions, I would guess that all of them that are only reading the data in the record do not use parameters. I generally only use parameters for call queries that are inserting/modifying data in a table. The parameters are always passed from the calling function.
This sounds like another endorsement to eliminate the use of ACCESS and switch to SQL.
Sub vs Function. I will have to think about how I would set MasterBaseQuery() up as a function and how many calling functions would have to be changed. That really sounds like a big job. But I might be willing to take that on.
Return object instead of string. I assume you are referring to the calling function, GetFilePath(). I changed it from Object to string and noticed no difference.
The content concerning GetFilePath() I do not fully comprehend. Could you please dumb that down a little for me? That does sound like something that could cause a problem.
Perhaps either of you might give me an idea of what a clean GetFilePath() and MasterBaseQuery should look like?
At the end of the day, MasterBaseQuery() is called by a whole lot of different functions (over 100) that are doing a whole lot of different things with the data called up. This is the only one that I know of that is not yielding the correct results.
Anyway, I will put some effort into trying to check out everything you mentioned.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|