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
Syntax error with SaveChanges
-
- Posts: 8
- Joined: Thu 12 Dec 2013 22:30
Re: Syntax error with SaveChanges
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 ()
Insert into () values ()
rather than
Insert into onlineaccount () values ()
Re: Syntax error with SaveChanges
Please specify the exact version of your PostgreSQL server and send us a small test project to reproduce the problem in our environment.
-
- Posts: 8
- Joined: Thu 12 Dec 2013 22:30
Re: Syntax error with SaveChanges
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
Kevin Clark
Seton Home Study School