Hi all
I am having problems when trying to insert records using dbi-0.1.0 on
Windows XP.
I am using the ADO driver to connect to SQL Server, like so:
connectString = "DBI:ADO:provider=SQLOLEDB.1;Data Source=10.0.0.1;User
id=xxxx; password=xxxx;Initial Catalog=DevDB"
I get rows == nil when I run this:
qry = "insert into G2.dbo.Device (IPadress, SerialNumber, VehicleID, " +
"SerialNumberB, Tag1, Tag2, FwVersion, HwVersion) values
(?, ?, ?, ?, ?, ?, ?, ?)"
rows = @database.do(qry, device[:ip], device[:serial],
device[:serial], device[:serial], 0, 0, 0, 0)
print "rows done: "
p rows
..and the record is not inserted. I get no other error response.
The strange thing is that select queries function perfectly, giving me
valid data back.
Any ideas?
Les
Leslie Viljoen wrote:
Hi all
I am having problems when trying to insert records using dbi-0.1.0 on
Windows XP.
I am using the ADO driver to connect to SQL Server, like so:
connectString = "DBI:ADO:provider=SQLOLEDB.1;Data Source=10.0.0.1;User
id=xxxx; password=xxxx;Initial Catalog=DevDB"
I get rows == nil when I run this:
qry = "insert into G2.dbo.Device (IPadress, SerialNumber, VehicleID, " +
"SerialNumberB, Tag1, Tag2, FwVersion, HwVersion) values
(?, ?, ?, ?, ?, ?, ?, ?)"
rows = @database.do(qry, device[:ip], device[:serial],
device[:serial], device[:serial], 0, 0, 0, 0)
print "rows done: "
p rows
..and the record is not inserted. I get no other error response.
The strange thing is that select queries function perfectly, giving me
valid data back.
Any ideas?
Les
Did you commit after inserting?
- Dan
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
You were right! I didn't realise that some databases don't commit automatically!
I'm really grateful for your help.
Les
···
On 7/28/06, Daniel Berger <Daniel.Berger@qwest.com> wrote:
Leslie Viljoen wrote:
> Hi all
>
> I am having problems when trying to insert records using dbi-0.1.0 on
> Windows XP.
> I am using the ADO driver to connect to SQL Server, like so:
>
> connectString = "DBI:ADO:provider=SQLOLEDB.1;Data Source=10.0.0.1;User
> id=xxxx; password=xxxx;Initial Catalog=DevDB"
>
> I get rows == nil when I run this:
>
> qry = "insert into G2.dbo.Device (IPadress, SerialNumber, VehicleID, " +
> "SerialNumberB, Tag1, Tag2, FwVersion, HwVersion) values
> (?, ?, ?, ?, ?, ?, ?, ?)"
> rows = @database.do(qry, device[:ip], device[:serial],
> device[:serial], device[:serial], 0, 0, 0, 0)
> print "rows done: "
> p rows
>
> ..and the record is not inserted. I get no other error response.
>
> The strange thing is that select queries function perfectly, giving me
> valid data back.
> Any ideas?
>
> Les
>
Did you commit after inserting?