05-23-2015 12:46 AM
I am writing a database program and have come across this error -
ADO Error: 0x00000001
Argument error. One of the column names specified is blank.
I have tried everything I can think of and have no idea what to try next.
The VI that the error is occuring in (attached written in LV 2011) allows the user to enter in the details of a new user. It then looks up this user to get the ID (primary key) of the user which will be used in another step of the program. The VI writes to the database fine but then comes back with the above error when using the SELECT query. All columns in the database have data in them. Also when i use a differnt VI that just looks up the user/customer it works fine.
I have tried deleting all the code and copying the code from the simpler (look up only) VI but I still get the same error.
I created an indicator for the concatenated text to make sure the query was right and it appears to be fine. So now I am stumped. Any help would be greatly appreciated.
Thanks
05-23-2015 05:37 PM
@tripped wrote:
I am writing a database program and have come across this error -
ADO Error: 0x00000001
Argument error. One of the column names specified is blank.I have tried everything I can think of and have no idea what to try next.
The VI that the error is occuring in (attached written in LV 2011) allows the user to enter in the details of a new user. It then looks up this user to get the ID (primary key) of the user which will be used in another step of the program. The VI writes to the database fine but then comes back with the above error when using the SELECT query. All columns in the database have data in them. Also when i use a differnt VI that just looks up the user/customer it works fine.
I have tried deleting all the code and copying the code from the simpler (look up only) VI but I still get the same error.
I created an indicator for the concatenated text to make sure the query was right and it appears to be fine. So now I am stumped. Any help would be greatly appreciated.Thanks
The query "appears" fine. Well, obviously it isnt' fine. The database is telling you that.
What is the SELECT query you are sending?
05-23-2015 05:59 PM
Your 2nd while loop in the first frame of your sequence structure has a problem. It will either run one time or run forever. It is seeing if the string is empty, and if so continues on. But the value of that string can never change because it comes from outside the while loop.
05-24-2015 03:02 PM
The query in straight SQL would read
SELECT CustomerID From Customer
Where MFirstName = '.....'
AND MLastName ='....'
AND Email = '.....@...'
AND Country = '.......';
With all the name, email, country strings coming in from the previous frame.
So have wired up customerID to the coulmns as that is the data that i want. have wired customer to table as thats the table to read from.
Then the where statement is concatenated strings which when printed out in an indicator nothing jumps out at me as written wrong.
05-24-2015 03:04 PM
Yes this is just messy programming which I will fix up once i have figured out why the SQL query isn't working. The way it is wired at present it will only ever execute once as the previous frame will not progress unless the email string is complete and so the empty string boolean can never be true.
The problem is in the select query to the database.
05-25-2015 05:54 AM - edited 05-25-2015 05:57 AM
Your comment betrays the underlying problem, "straight SQL" is all you should be using. Next, get rid of the sequence -- it's unnecessary and makes things worse by hiding logic. None of the error clusters are connected. Fix the code now -- always start with known problems before you worry about unknown ones. Often times fixing the know ones (like terrible code) will fix teh unknown ones.
But to your immediate problem, what does string you are sending to the database look like? Have you tried probing it?
Mike...