Anybody had a chance to look at vbscript with access 2007? There is a new field type called attachment and I would like to be able to add an attachment to this field in a vbscript that I am writing. However when I try to add a record I am getting an error An INSERT INTO query cannot contain a multi-valued field.
Any ideas?
bn2hunt
"Born to hunt forced to work
Code:
Dim cn, cmd, date_time, logfile, mb, model, pcname, results, serial
date_time = ""
logfile = "a:\log.txt"
mb = "1"
model = "2"
pcname = "3"
results = "4"
serial = "5"
cnstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\fs01\ho_data_processing\DP_Technical_Services\wipedrive\wipedrive.accdb;Persist Security Info=False;User ID=;Password="
cmdtext = "INSERT INTO wipedrive (date_time, " & _
"logfile, " & _
"mb, " & _
"model, " & _
"pcname, " & _
"results, " & _
"serial)" & _
"VALUES ('" & date_time & "', " & _
"'" & logfile & "', " & _
"'" & mb & "', " & _
"'" & model & "', " & _
"'" & pcname & "', " & _
"'" & results & "', " & _
"'" & serial & "')"
Set cn = CreateObject("adodb.connection")
Set cmd = CreateObject("adodb.command")
cn.connectionstring = cnstring
cn.Open
cmd.activeconnection = cn
cmd.commandtext = cmdtext
cmd.Execute
cn.Close
Any ideas?
bn2hunt
"Born to hunt forced to work