Application won't run in the US

J

John Dann

I have a vb.net application that uses ado.net to populate an Access
database that the program itself creates. This was developed using a
UK locale and runs fine on several PCs/Windows versions using UK
locale. However a couple of US-based beta testers are finding that the
program is raising major errors that seem to involve the database. A
typical scenario seems to be:

1. An empty Access database is created using ADOX and closed;

2. A dataset is created in memory and used to update the database via
a data-adapter;

3. The database is queried for the last record (actually there's a
datetime key field and it's queried for max(datetime));

The error on US machines seems to be that the database is still open
at step 3 despite using the da, which I though automatically opened
and closed the database as needed.

I can't be sure at this stage that the bug is locale-related but if
not it's certainly a big coincidence. Unfortunately I don't seem to be
able to replicate the bug by temporarily switching a UK-locale PC to
US-locale.

I realise this is a pretty broad question, but can anyone think of any
general reason - anywhere to begin hunting down the bug - why this
might be happening? Of course as soon as I mention datetime, there's
the possibility of culture/format differences. But there's nowhere in
the program where the datetime is parsed from the local format.

There are a couple of places where a new datetime is set from:

datetime = New Date(year, month, day etc)

but I'm assuming that this is a culture-independent construction.

Thanks
JGD
 
W

W.G. Ryan MVP

John:

First, about the OPening and Closing - the adapter will do this for you only
if the connection is closed when you fire the query. If it's open, then it
will stay open.

Second, if you can pull the data in in step 2 and send updates back, then I
doubt it's a format thing. It would be helpful to know the exact error
message you're getting. However if you can fill it and update it, I think
it's something else. Just to be sure, fire an ExecuteNonQuery and/or
ExectueScalar just to make sure you can fire the command with the Date field
in the restriction. You can also specify the currentculture
http://msdn.microsoft.com/library/d...ide/html/cpconusingcurrentcultureproperty.asp

and set it http://www.syncfusion.com/FAQ/aspnet/WEB_c12c.aspx

Let me konw if this doesn't fix it or if I misunderstood you.

Thanks,

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top