Group:  Microsoft Access ยป microsoft.public.access.odbcclientsvr
Thread: Update system DSN via VBA

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Update system DSN via VBA
"Randy K." <Randy.Kennedy[ at ]NOSPAM.engineer.com> 29.08.2006 15:28:25
I have a .mdb that uses a system DSN for a connection to an Informix
database. Currently, the DSN on all client PC's were created with the same
username/password and the tables were all linked using that
username/password. The newest Informix ODBC driver no longer stores the
username/password in the system tables, it references the DSN for that
information. I would like to be able to have application update the DSN on
startup so the database is aware of the true person connected, not the
original username used to create the DSN. I have seen a few examples of
creating/modifying DSN's via VBA, but they are always showing a SQL Server
example using trusted connections and that is not applicable for my
situation.

Any ideas?

TIA,
Randy


Re: Update system DSN via VBA
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> 29.08.2006 21:22:49
DSNs are simply registry entries (under HKLM\Software\ODBC or
HKCU\Software\ODBC, depending on the type of DSN). While there are
DSN-specific API calls, you can also just use your normal registry-related
API calls.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Randy K." <Randy.Kennedy[ at ]NOSPAM.engineer.com> wrote in message
news:u29BG$3yGHA.4932[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text]
>I have a .mdb that uses a system DSN for a connection to an Informix
>database. Currently, the DSN on all client PC's were created with the same
>username/password and the tables were all linked using that
>username/password. The newest Informix ODBC driver no longer stores the
>username/password in the system tables, it references the DSN for that
>information. I would like to be able to have application update the DSN on
>startup so the database is aware of the true person connected, not the
>original username used to create the DSN. I have seen a few examples of
>creating/modifying DSN's via VBA, but they are always showing a SQL Server
>example using trusted connections and that is not applicable for my
>situation.
>
> Any ideas?
>
> TIA,
> Randy
>


Re: Update system DSN via VBA
"Randy K." <Randy.Kennedy[ at ]NOSPAM.engineer.com> 05.09.2006 15:38:45
OK, I see the key, but the PWD value is "EP 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0" which is not the valid password for the user it was
created as. How do I use regular registry calls and properly set the PWD,
mainly so that it is not opentext, but it recognized by the database server
(these are system DSN's)?

TIA,
Randy

"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> wrote in message
news:u0qGLF7yGHA.4796[ at ]TK2MSFTNGP06.phx.gbl...
[Quoted Text]
> DSNs are simply registry entries (under HKLM\Software\ODBC or
> HKCU\Software\ODBC, depending on the type of DSN). While there are
> DSN-specific API calls, you can also just use your normal registry-related
> API calls.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Randy K." <Randy.Kennedy[ at ]NOSPAM.engineer.com> wrote in message
> news:u29BG$3yGHA.4932[ at ]TK2MSFTNGP02.phx.gbl...
>>I have a .mdb that uses a system DSN for a connection to an Informix
>>database. Currently, the DSN on all client PC's were created with the
>>same username/password and the tables were all linked using that
>>username/password. The newest Informix ODBC driver no longer stores the
>>username/password in the system tables, it references the DSN for that
>>information. I would like to be able to have application update the DSN
>>on startup so the database is aware of the true person connected, not the
>>original username used to create the DSN. I have seen a few examples of
>>creating/modifying DSN's via VBA, but they are always showing a SQL Server
>>example using trusted connections and that is not applicable for my
>>situation.
>>
>> Any ideas?
>>
>> TIA,
>> Randy
>>
>
>


Re: Update system DSN via VBA
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> 05.09.2006 21:23:06
Sorry, I don't know. I'd never want to have passwords stored, so I haven't
looked into how they're encrypted.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Randy K." <Randy.Kennedy[ at ]NOSPAM.engineer.com> wrote in message
news:uaaejFQ0GHA.2516[ at ]TK2MSFTNGP06.phx.gbl...
[Quoted Text]
> OK, I see the key, but the PWD value is "EP 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0" which is not the valid password for the user it was
> created as. How do I use regular registry calls and properly set the PWD,
> mainly so that it is not opentext, but it recognized by the database
> server (these are system DSN's)?
>
> TIA,
> Randy
>
> "Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> wrote in message
> news:u0qGLF7yGHA.4796[ at ]TK2MSFTNGP06.phx.gbl...
>> DSNs are simply registry entries (under HKLM\Software\ODBC or
>> HKCU\Software\ODBC, depending on the type of DSN). While there are
>> DSN-specific API calls, you can also just use your normal
>> registry-related API calls.
>>
>> --
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no private e-mails, please)
>>
>>
>> "Randy K." <Randy.Kennedy[ at ]NOSPAM.engineer.com> wrote in message
>> news:u29BG$3yGHA.4932[ at ]TK2MSFTNGP02.phx.gbl...
>>>I have a .mdb that uses a system DSN for a connection to an Informix
>>>database. Currently, the DSN on all client PC's were created with the
>>>same username/password and the tables were all linked using that
>>>username/password. The newest Informix ODBC driver no longer stores the
>>>username/password in the system tables, it references the DSN for that
>>>information. I would like to be able to have application update the DSN
>>>on startup so the database is aware of the true person connected, not the
>>>original username used to create the DSN. I have seen a few examples of
>>>creating/modifying DSN's via VBA, but they are always showing a SQL
>>>Server example using trusted connections and that is not applicable for
>>>my situation.
>>>
>>> Any ideas?
>>>
>>> TIA,
>>> Randy
>>>
>>
>>
>
>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net