I’m working on a Project now which consists of gathering data from a leak test. The data is then organized and sent to an SQL database on the company’s server. My main problem right now is that I’m unable to send data to my database.
I have tried sending just basic data through Microsoft SQL Server Management Studio and have had success with that, but I’m encountering trouble with the LabWindows SQL commands.
Most of the lines of code are meant only to establish a connection with my database. I’ve followed whatever guidelines I could find regarding SQL on LabWindows. I added two PrintF commands to test the connection, to which I got the following results:
According to the documentation I could find on the subject this is what I got:
- A result lower than 0 would imply there is an error with the OBDC handle
- A result equal to 0 implies there is no error with the connection
From this I assumed that there is a connection to the database and that my problem is merely my use of the commands meant to send information to the database. However due to my lack of knowledge of LabWindows/SQL in general I’m not sure.
So far, I’ve tried using different commands such as:
- DBImmediateSQL
- DBPrepareSQL and DBExecutePreparedSQL
But in the end, I get the same error which is:
Basically, telling me the table “Personas” could not be found. Now, I know that table does exist because I can see it on Microsoft SQL Server Management Studio but for some reason LabWindows is not able to locate it. I reviewed the error code but im afraid it didn’t really give me much of an answer. I have a few ideas of what might be wrong:
- Maybe my connection string is not working. To the best of my knowledge I believe it is working, all the information is correct I double checked, and it is written according to the examples set by NI.
- Maybe my assumption that there is connection to the database is incorrect.
- Maybe I’m just using the commands incorrectly.
All in all, I’m open to trying new things, if someone has any clue of what might be wrong I would appreciate any help you might be able to offer.