Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 187
  • Last Modified:

database access through ActiveX

I have a web page written in JavaScript.  I have an ActiveX control that reads from a database and returns information to the web page.  This works fine if the ActiveX control is accessed in client side script.  HOWEVER, when I try to call the function that accessed the database from the server side script, I get the following message from the ActiveX control (written in MFC):

m_nRetCode: [-1]
m_strError: [Only SQL_DRIVER_NOPROMPT is allowed when connection pooling is enabled ]
m_strStateNativeOrigin:[State:S1110,Native:0,Origin:[Microsoft][ODBC Driver Manager] ]

Does anyone know how to fix this?

allie

0
allie
Asked:
allie
1 Solution
 
DanRollinsCommented:
In the fn to open the database, there is a dwOptions flag.  If you have any way to set that flag to noOdbcDialog (actual value is 8), the problem will go away.

-- Dan
0
 
allieAuthor Commented:
Sorry, forgot to post that I'd figured it out, but that's exactly what I did.  I opened the database using:

CDatabase cMyDB;
cMyDB.OpenEx(szDSN, CDatabase::noOdbcDialog);

Note that you have to use OpenEx(), not Open().  Then I passed the pre-opened database to the recordsets I wanted to use.  Works fine now.  Thanks!

allie
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now