Question Changing Connection String for ODBC Linked Table (1 Viewer)

Tanner65

Registered User.
Local time
Yesterday, 21:34
Joined
Aug 31, 2007
Messages
66
I have a linked table (which is actually a view) and I need to change the view from being normal to read only.

I know I can do this by adding OPENMODE=1 to the connection string, but I'm unable to change the connection string in the Windows ODBC manager or in the MSysObject table.

Any suggestions?
 

Banana

split with a cherry atop.
Local time
Yesterday, 19:34
Joined
Sep 1, 2005
Messages
6,318
I would think it'd be easier to just leave the view as editable, then if you need a read-only, alter the properties in recordset or form as appropriate-

For DAO recordset, open it as dbOpenSnapshot, which will be read only (but it will have performance ramifications). For ADO recordset, use adLocksReadOnly (Not sure if spelling is right). For Forms, set properties .AllowEdits and .AllowAdditions and .AllowDeletions to false.
 

Tanner65

Registered User.
Local time
Yesterday, 21:34
Joined
Aug 31, 2007
Messages
66
I would think it'd be easier to just leave the view as editable, then if you need a read-only, alter the properties in recordset or form as appropriate-

For DAO recordset, open it as dbOpenSnapshot, which will be read only (but it will have performance ramifications). For ADO recordset, use adLocksReadOnly (Not sure if spelling is right). For Forms, set properties .AllowEdits and .AllowAdditions and .AllowDeletions to false.


I apologize for not clarifying. I need to query the view using a query that returns the same results as my application. The application allows for the connection string to be changed, but not the linked tables or query.

Thanks for the tip though! :)
 

Banana

split with a cherry atop.
Local time
Yesterday, 19:34
Joined
Sep 1, 2005
Messages
6,318
You still can set the query to be read only by changing the query's property RecordsetType to Snapshot.
 

Tanner65

Registered User.
Local time
Yesterday, 21:34
Joined
Aug 31, 2007
Messages
66
After digging through the registry I found the solution.

1) Find the \HKLM\Software\ODBC\ODBC.INI\<DSN To Set To Readonly>
2) Click "Edit" and select "New" then "String Value"
3) Change the name from "New Value #1" to "OpenMode"
4) Right click and select Modify
5) Make the value 1. (For Pervasive SQL this sets the connection Read Only)


Thanks for your help Banana. :)
 

Users who are viewing this thread

Top Bottom