Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / May 2005

Tip: Looking for answers? Try searching our database.

Submitting using Custom Code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mdsmitty - 27 May 2005 15:51 GMT
At the moment, my form will not allow me to submit back to my SQL data
source.  When I go to Submitting Forms, the "Database" selection is not
available.  Is there a way to write VBScript as a work around?  If so, does
anyone know how or what to write as I am very new to writing VBScript.

I have read that there is an issue with having "long data types".  Is it
possible that I will need to change my SQL table properties?

Thanks
Alex [MSFT] - 27 May 2005 17:06 GMT
To your Submitting Forms question: to see database from the dropdown,
you need to start your form template from the database. Go to "File |
Design a Form | New from data connection" and select your database.

-----Original Message-----
From: mdsmitty [mailto:mdsmitty@discussions.microsoft.com]
Posted At: Friday, May 27, 2005 7:51 AM
Posted To: microsoft.public.infopath
Conversation: Submitting using Custom Code
Subject: Submitting using Custom Code

At the moment, my form will not allow me to submit back to my SQL data
source.  When I go to Submitting Forms, the "Database" selection is not
available.  Is there a way to write VBScript as a work around?  If so,
does
anyone know how or what to write as I am very new to writing VBScript.

I have read that there is an issue with having "long data types".  Is it

possible that I will need to change my SQL table properties?

Thanks
mdsmitty - 27 May 2005 17:45 GMT
I have...I created my form using a data source.  I believe that the issue is
actually with the "data type" properties within my SQL database.  I tested a
database that was working with the submit and then the one I was trying to
work with and matched the "data types" which now allows me to submit.  I now
have another error resulting while testing my form in the Preview mode...

InfoPath cannot submit the form.
An error occurred while the form was being submitted.

[0x80040E2F][Microsoft OLE DB Provider for SQL Server] Violation of PRIMARY
KEY constraint 'PK__Account__072CF7AA'. Cannot insert duplicate key in object
'Account'.
[0x80040E2F][Microsoft OLE DB Provider for SQL Server] The statement has
been terminated.

In this instance, I am trying to add a new entery into the database tables
"on the fly".  It actually worked the first time but I got the error
everytime after that.  I don't have any problems with existing records in the
Database.

> To your Submitting Forms question: to see database from the dropdown,
> you need to start your form template from the database. Go to "File |
[quoted text clipped - 18 lines]
>
> Thanks
Scott L. Heim [MSFT] - 27 May 2005 19:50 GMT
Hi,

Try to add the same *identical* record manually as you were trying with
InfoPath - this is a SQL Server primary key violation error so you should
probably get the same error manually.

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
mdsmitty - 27 May 2005 22:00 GMT
Question...when InfoPath Submits to the database, is it updating or inserting
into the database?

> To your Submitting Forms question: to see database from the dropdown,
> you need to start your form template from the database. Go to "File |
[quoted text clipped - 18 lines]
>
> Thanks
halkar - 30 May 2005 13:22 GMT
To my understanding it inserts, use custom code for updates and inserts
with caluse "where" etc.

What is the Account column in your database that you are using as
Primary Key? Is it an Identity column? Is it auto incremented? You
might need to reseed the identity if you have manually removed any
records from the table by using DBCC CHECKINDENT(tablename, reseed, 1)
(The number 1 is the number you want to auto increment to start or
continue from)

If none of the conditions are true for you, you can try adding a new ID
column and use it as the Primary Key.

--
halkar

mdsmitty - 31 May 2005 15:47 GMT
Thanks for the help gentlemen.  I needed to change my primary key.  I added a
new column called info_number, auto incremented, and used it as the primary
key.  Now I can add new records to my blank table which is my objective.

> To my understanding it inserts, use custom code for updates and inserts
> with caluse "where" etc.
[quoted text clipped - 16 lines]
> View this thread: http://www.mcse.ms/message1640200.html
>  

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.