I must be doing something wrong, but I can’t figure it out. I have simplified the process, so I am only inserting 1 field to create a new record in an Access DB table. I get the subject out of an email and add it into a new rec in a table. The email part works fine, and I assign the subject to a variable ie.
strSubject = item.subject
I can then display the string strSubject in a message box.
I then connect to the Access DB
ConnectionString: “Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\DATA\aSmallWerxs\BMS.accdb”
I test the connection and it is OK.
I then do a Execute Non Query to insert the record ie.:
Existing Connection: BMSConnect
- Name: strSubject
- Direction: In
- Type: String
- Item: Subject
Sql: “INSERT INTO HDTicket_tbl(Title) values(@strSubject)”
So when I run the program a new record is created but strSubject is not passed into the table.
If I change it so I pass in item.subject the subject is not passed in. The only way the data is added is if I actual manually put the data in the SQL statement ie:
Sql: “INSERT INTO HDTicket_tbl(Title) values(‘Problem backing up application’)”
Thanks for any help