MSSQL SERVER


mrmainwoods

Recommended Posts

Has anyone gotten sql server to work with DF logging? I am having a horrific time getting it working.

I constantly get C1011 Could not create table for logging. Msg: Incorrect Syntax near ')'.

Is this a potential bug that we dont know about, or am I missing something simple. I know SQL server uses CREATE TABLE, and INSERT, but niether of them seem to work.

If any body can shead some light on this little nugget of fun, I would greatly appreciate it!

Cheers!

Greg P.

Link to comment
Share on other sites

1) first make sure you don't already have the table and have created the database. My guess is you are beyond this.

2) errors like this usually mean that the SQL statement is incorrect for your dialect of SQL. For example, while SQL server uses CREATE TABLE and INSERT, it does not use DOUBLE (which DF defaults to), but instead uses REAL. Click on the SQL button to the right of the data source edit box in the logging set and change the DOUBLE to REAL and hopefully that will resolve your problem.

Link to comment
Share on other sites

Great. Now before you bang your head against another wall, I should point out a bug in SQL Server. For some reason when you send it date/time in numeric format, which should be in decimal days since 1900 to match up with Access, Excel and other Microsoft office products, the date appears off by two days in SQL server. Makes no sense to me unless they missed a leap year or two. They may have fixed this, but just in case, we've added a variable to the logging set that allows you to offset the time being logged. To set this, in a sequence marked Auto-Start, put something like:

logging.mylog.TimeOffset = 86400*2

I truthfully can't remember whether it needs to be positive or negative, but I think its positive. It'll be pretty obvious.

Anyhow, try it without it first, but if you find your dates are off by two days, this is how to fix it.

Link to comment
Share on other sites

OK, so this system tested OK on writing to a remote SQL Server on our network, but it won't write locally to an SQL DB. Is there something Missing? I have done the ODBC Connection Manager, but I keep getting the same response from DF.

C1010 Error opening Data Source: Data Source Name not found, and No default driver Specified.

Data Logging Failure. I think the connection I configured is OK, and it tests OK, but the DF Cannot See it.

Thoughts?

GP

Link to comment
Share on other sites

Its definitely a problem with the ODBC setup. DAQFactory doesn't really know if you are connecting locally or remotely and sends the same commands in all cases. It doesn't really even know what database type you are connecting to, which is why we have to give you the option to change the SQL dialect, i.e. your first issue.

In this case it sounds like you have the data source name wrong. Either its not reachable from DAQFactory (you probably want a system DSN, not a user DSN), or you have a password on it, but I'm not completely sure.

If you continue to have problems with it, give us a call and we can connect in and take a peek.

Link to comment
Share on other sites

  • 1 year later...

Hi!

i had a problem like "mrmainwoods" but i solved it with changing the "double" section to "real". it's all ok. but

now i have another error msg like that.

"there is already an object named." in database, there is no table or somthing like msg said.

can you help me about it?

Link to comment
Share on other sites

That's a new message to me, but these messages are whatever the ODBC driver tells DAQFactory. You might search the Internet for that exact message and see what comes up. Its not DAQFactory specific, but rather specific to your database and the matching ODBC driver.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.