I’ve been working with dm83737 and we were running into problems using MS Access so we decided to set up a connection to a Microsoft SQL Server to hopefully avoid getting the INSERT error.
So now when I want to add a record to the Microsoft SQL DB, I get an error. The code we are using is listed below along with the error.
//set up connection to DB
set myDB to (type:"odbc",DSN:"eggPlantTestDB",user:"eggplant",password:"EggPl@nt$")
put table "eggPlant_test.dbo.ResultsTable" of myDB into resultsTable
put table "eggPlant_test.dbo.CreateNewAccount" of myDB into dataTable
//setting up iterator for CreateNewCerts DB
set dataIterator to iterate over the records of dataTable
//getting the record in the table
put dataIterator’s nextValue into currentData
//makes a copy of currentData that is not connected to the db to avoid No Primary Key error w/ MS Access
put currentData into clientInfo
//verify right data is being sent
log clientInfo
//adding a record to the Results Table
add record clientInfo to resultsTable
I’ve ran:
log resultsTable recordInfo
And the result comes back with (Name:“ID”, Type:“integer”) for the fields in the DB. None come back with (KeyType:“Primary”, Name:“ID”, Type:“integer”) and I have a primary key set up. When I run
log dataTable recordInfo
The primary key is not shown for any of the fields in that table as well, even though I have a primary key set up.
I was excited when you came out with the ability to read/write to a DB in the last update because I knew this would help our team greatly when creating the scripts we are needing. So any help with this would be very much appreciated! Thanks!