Page 1 of 1

Syntax error with SaveChanges

Posted: Thu 12 Dec 2013 22:36
by KevClark64
I am trying to insert a new record, but when I execute SaveChanges, I get an error saying "Syntax error at or near "("". The data that I am submitting looks okay, and all the non-nullable fields are filled in (except for one sequence field that Postgres generates itself). I'd like to know either how to fix this error or see what the SQL is that is being submitted. Here is the code I am running:

Dim newacct As New OnlineEnrollment.onlineaccount
newacct.custnum = Me.custnum
newacct.emailaddress = Me.email(0).email
newacct.lastname = Me.lname
newacct.firstname = Me.fname
newacct.password = GenerateRandomString(8, True)
newacct.datecreated = Now
olEnr.onlineaccounts.AddObject(newacct)
olEnr.SaveChanges()

Any ideas on solving this problem?

Kevin Clark

Re: Syntax error with SaveChanges

Posted: Thu 12 Dec 2013 22:55
by KevClark64
I was able to pull up the SQL that is being generated by SaveChanges. The problem seems to be that the tablename is not contained in the SQL. The SQL is something like:

Insert into () values ()

rather than

Insert into onlineaccount () values ()

Re: Syntax error with SaveChanges

Posted: Mon 16 Dec 2013 14:25
by Shalex
Please specify the exact version of your PostgreSQL server and send us a small test project to reproduce the problem in our environment.

Re: Syntax error with SaveChanges

Posted: Tue 17 Dec 2013 15:45
by KevClark64
We were using an older version of dotConnect. When we upgraded to the latest version, the problem went away.

Kevin Clark
Seton Home Study School