Click here to Skip to main content
15,889,453 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have connected to my SQL Server 2005 database by using ADO (through A set of ADO classes - version 2.20 by Carlos Antollini). Now I have set the connection mode to be ReadOnly
CADODatabase *pDatabase = NULL;
pDatabase = new CADODatabase();
pDatabase->SetConnectionString(MyConnectionString);
pDatabase->SetConnectionMode(CADODatabase::connectModeRead);
pDatabase->Open();
SetConnectMode() calls ADODB::Connection15::PutMode
and CADODatabase::connectModeRead is adModeRead.

Now my understanding is that setting the adModeRead mode should make the database connection read-only. But a simple test of the connection shows that I can use the connection to create and drop tables, as well as insert and update data.

How can I make the connection truely read-only?
Posted

1 solution

You need to set the connection mode in connection string itself.

Please search on the google to find out how it is done.

I have same problem in my VB based application . I found the same solution using above technique.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900