VB Scripting and XP Embedded

N

nonsbr

Hi!

We are at the end of our rope with an issue we are having using xp
embedded, so hopefully somebody out there has had some experience with
this.

First, we are using an OEM image of XP embedded (slightly customized)
that we are running on HP t5700 thin client devices.

What we are trying to do is connect to an sql database using a vb
script that contains a simple con.open connection string. No matter
how we have varied the script, it still fails. Conversely, when
creating a DSN entry to the database, we are able to connect. This
leads us to believe that the issue is with the script and not the
workstations ability to connect in the first place.

So I guess the question is has anyone had any experience with doing
sql queries from XPE? Here is an example of the code we are using:


Set con = CreateObject("ADODB.Connection")
Con.Open ("Driver={SQL Server};Server=x.x.x.51;Uid=userid;Pwd=pword")

Seems pretty straight forward, but every time we run it, we get the
very helpful "80004005 unspecified error" message. We have tried with
dsn and dsn-less connection attempts.

Thanks in advance!
 
K

KM

nonsbr,

Comments inline...

Before going to the XPe troubleshooting route (FileMon/Regmon/DependencyWalker/etc.) it may make sense to check out what's in your
image and how the script works on XP Pro.

--
Regards,
KM, BSquare Corp.

Hi! .....

First, we are using an OEM image of XP embedded (slightly customized)
that we are running on HP t5700 thin client devices.

What we are trying to do is connect to an sql database using a vb
script that contains a simple con.open connection string. No matter
how we have varied the script, it still fails. Conversely, when
creating a DSN entry to the database, we are able to connect.

This way most likely you tested ODBC driver (SQL Server) only.
This leads us to believe that the issue is with the script and not the
workstations ability to connect in the first place.

Not true. That may also mean you've got problems with OLE DB provider (SQL Server).


Do you have "Microsoft Data Access Components (MDAC)" (better Hotfix Q824704) component in your image?
So I guess the question is has anyone had any experience with doing
sql queries from XPE? Here is an example of the code we are using:


Set con = CreateObject("ADODB.Connection")
Con.Open ("Driver={SQL Server};Server=x.x.x.51;Uid=userid;Pwd=pword")

Using ADO will assume you need proper OLE DB provider (driver).

Btw, you can also try to use the created DSN here (add DSN=... in the connection string, or FILEDSN=... if you want to use saved DSN
file) if you know it worked for you.
Seems pretty straight forward, but every time we run it, we get the
very helpful "80004005 unspecified error" message. We have tried with
dsn and dsn-less connection attempts.

What line of the VB code errors out? The .Connect call or else?
If else, there may also be ADO marshaling some certain data types issue (adVariant). But then you need to debug the script on XP Pro
machine first (have you do that, btw?).

KM
 

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