Classic ASP / VBscript

General PGNP discussions.

Classic ASP / VBscript

Postby h0tw1r3 » Tue Aug 25, 2009 1:14 pm

I am attempting to make a connection to a local install of pg 8.4 using ASP under IIS 7 (windows 7).

File: test.asp
Code: Select all
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=PGNP.1;Data Source=localhost;Initial Catalog=postgres;User ID=postgres;Password=admin;"
objConn.Open


Results in an infinite loop. The script never returns and I must kill the application pool. I turned on debugging, but nothing shows up.


I then decided to test a connection using the command line.

File: test.vbs
Code: Select all
Set objConn = CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=PGNP.1;Data Source=localhost;Initial Catalog=postgres;User ID=postgres;Password=admin;"
objConn.Open


Run: cscript /nologo test.vbs

This time I get a popup dialog asking if I agree to the license (trial), I select agree, and the script continues successfully.
My problem lies in the fact that "I agree" is not saved and therefor the dialog pops up every time the dll is loaded. This is a problem when trying to evaluate your product on IIS as it suppresses the dialog and enters an infinite loop waiting for me to select "i agree", which is simply not possible.

Is there any way to work around this problem? I am currently using the open source pgoledb, but would prefer a commercially supported product.
h0tw1r3
 
Posts: 3
Joined: Tue Aug 25, 2009 12:54 pm

Re: Classic ASP / VBscript

Postby Moderator » Wed Aug 26, 2009 8:45 pm

Are you using Vista with UAC enabled? Then launch the test from command prompt with Administrator permissions. In this case the dialog will be shown only 1 time a day.

Another reason is that the IIS application is running under different user account (Local System, etc.) than your current session. Dialog is shown per user.

If none of the above helps, please PM us and we'll send you a trial build without the reminder dialog.
User avatar
Moderator
Site Admin
 
Posts: 301
Joined: Wed Oct 29, 2008 11:27 pm

Re: Classic ASP / VBscript

Postby h0tw1r3 » Thu Aug 27, 2009 12:47 pm

1. The IIS application pool is running under my local, logged-in user account.
2. Running the script from WSH command line results in the dialog every time i execute the script, regardless of what user I run it under (my account, administrator, etc).
3. Using a tool such as AnySQL Maestro and creating a connection through your driver produces the same results.

UAC was/is disabled on the machine throughout all tests.

Since I am using Windows 7, which is yet to be released, I also tried the above tests on Windows XP.
The results were exactly the same. A dialog for every new connection.

These tests would lend my to conclude that the problem is not specific to me, but perhaps the downloads available on the site are faulty. (note, I also tried all tests with the 1.3 beta download).
h0tw1r3
 
Posts: 3
Joined: Tue Aug 25, 2009 12:54 pm

Re: Classic ASP / VBscript

Postby h0tw1r3 » Thu Aug 27, 2009 1:16 pm

I was able to fix the problem on both machines by creating the registry key, HKCU\Software\PGNP.
Apparently the installer, or the dll, never properly creates the key which causes the subsequent dialog answer to never be saved.

You can reproduce the problem by uninstalling the driver, deleting all PGNP registry keys, and reinstalling.
h0tw1r3
 
Posts: 3
Joined: Tue Aug 25, 2009 12:54 pm

Re: Classic ASP / VBscript

Postby Moderator » Thu Aug 27, 2009 9:59 pm

I've checked the code... Yes, the issue occurs when the key does not exists!

We'll add code to create the key.

Thank you so much for letting us know!
User avatar
Moderator
Site Admin
 
Posts: 301
Joined: Wed Oct 29, 2008 11:27 pm


Return to Miscellaneous

Who is online

Users browsing this forum: No registered users and 1 guest