Hi all,
I am having a problem with a GetSetting Function. I am saving the last DSN selected by a user in an ODBC connection form. Everything works fine, but if I delete the ODBC conection then run the VBapp I get a run time error 383 - "text property is read only"
My Syntax:
-------------------------
'Read in last DSN used
Dim lastdsn As String
lastdsn = GetSetting(App.EXEName, "Options", "DSN Name", ""![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
If lastdsn = "" Then
'Nothing
Else
cboDSNList.Text = lastdsn
End If
Exit Sub
-------------------------
If there is no 'lastdsn' (I.E. Deleted) the IF statement should be true. However, upon further checking, I found that the lastdsn is not pulling in an empty string but rather the NAME of the server I am connecting to?
Any ideas on how to avoid this error I am getting. Basically I want to populate a dropdown box with the DSN last used by the user. However if the DSN has been deleted from the system I just want it to be blank.
Note: deleting the DSN would not be done in the app but rather through the normal control panel (ODBC connections).
Any help is greatly appreciated.
Regards,
Mike
I am having a problem with a GetSetting Function. I am saving the last DSN selected by a user in an ODBC connection form. Everything works fine, but if I delete the ODBC conection then run the VBapp I get a run time error 383 - "text property is read only"
My Syntax:
-------------------------
'Read in last DSN used
Dim lastdsn As String
lastdsn = GetSetting(App.EXEName, "Options", "DSN Name", ""
If lastdsn = "" Then
'Nothing
Else
cboDSNList.Text = lastdsn
End If
Exit Sub
-------------------------
If there is no 'lastdsn' (I.E. Deleted) the IF statement should be true. However, upon further checking, I found that the lastdsn is not pulling in an empty string but rather the NAME of the server I am connecting to?
Any ideas on how to avoid this error I am getting. Basically I want to populate a dropdown box with the DSN last used by the user. However if the DSN has been deleted from the system I just want it to be blank.
Note: deleting the DSN would not be done in the app but rather through the normal control panel (ODBC connections).
Any help is greatly appreciated.
Regards,
Mike