Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running VB as an NTService

Status
Not open for further replies.

RexJacobus

Programmer
Dec 10, 2001
47
NZ
Hi,

I have to set up an NT Service which a VB app which calls several SQL Server 7 stored procedures. I have set up other services which don't connect to SQL server and they run fine.

Here is my code:

Public mCon As New ADODB.Connection
Public msConnectionstring As String

msConnectionstring = "provider=SQLOLEDB.1;server=" _
& msServer _
& ";Database=" _
& msDBName _
& ";uid=" _
& msUserName _
& ";password=" _
& msPassword _
& ";NetworkLibrary=TCPIP" _
& ";"

mCon.ConnectionTimeout = 0
mCon.Open msConnectionstring

When I run this as an exe it works a treat but it always hangs on mCon.Open when it runs as an service.

Has any body else had this problem

jim
 
It was a registry problem. The exe had no problems reading the registry but the NTService couldn't because settings were set up user specific.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top