Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Writing record to MSAccess DB
#7
I am sorry, Query cannot be used with SELECT. Then it always returns -1. I changed the code.

Quote:I have 14 fields in the actual database-this query only populates 4 of them. Do I have to account for the remaining (blank) fields in the INSERT query in some way?)

Yes. Example:

Code:
Copy      Help
;Fields: Ticket_No (Text) Service_Co (Text) Customer_Address (Text) Comments (Text)
;...

,;insert record
,sql.format("INSERT INTO ptdb (Ticket_No, Service_Co, Customer_Address, Comments) VALUES('%s','%s','%s','%s')" t c a m)
,;remaining fields will be empty
,


When posting QM code, please copy it using menu Edit -> Other formats -> Copy BBCode. Then it will be colored, which is easier to read.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)