473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Registry entry editing thru VBA

I want to change some DWORD value in the registry, Can I use VBA to do this?
Sep 30 '06 #1
1 2243
PEB
1,418 Expert 1GB
Hi,

It seems that yeah,
see this exemple...

RegisterDatabase Method Example

This example uses the RegisterDatabase method to register a Microsoft SQL Server data source named Publishers in the Windows Registry.

Using the Windows ODBC Control Panel icon is the preferred way to create, modify, or delete data source names.

Sub RegisterDatabaseX()

Dim dbsRegister As Database
Dim strDescription As String
Dim strAttributes As String
Dim errLoop As Error

' Build keywords string.
strDescription = InputBox( "Enter a description " & _
"for the database to be registered.")
strAttributes = "Database=pubs" & _
vbCr & "Description=" & strDescription & _
vbCr & "OemToAnsi=No" & _
vbCr & "Server=Server1"

' Update Windows Registry.
On Error GoTo Err_Register
DBEngine.RegisterDatabase "Publishers", "SQL Server", _
True, strAttributes
On Error GoTo 0

MsgBox "Use regedit.exe to view changes: " & _
"HKEY_CURRENT_USER\" & _
"Software\ODBC\ODBC.INI"

Exit Sub

Err_Register:

' Notify user of any errors that result from
' the invalid data.
If DBEngine.Errors.Count > 0 Then
For Each errLoop In DBEngine.Errors
MsgBox "Error number: " & errLoop.Number & _
vbCr & errLoop.Description
Next errLoop
End If

Resume Next

End Sub


Also You can do it using the .reg files...

:)
Sep 30 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Bob Kirkwood | last post by:
I believe the intent in .NET is that we store application setup information in an XML file now instead of the Registry or INI files. Is this correct? Are there any tools, sample apps, or...
5
by: RWC | last post by:
Hi! I'm having a problem in A2K2. This should be simple, but I can't really figure it out. First problem, I'm trying to set the property of a table, via Vb to hidden, and I aslo would like to...
3
by: Phil Stanton | last post by:
When I get an open a photo in an imagecontrol I am getting a box that briefly shows the import process. Now I know I can suppress this by editing the registry with ...
3
by: techmaccoy | last post by:
I am trying to access a entry under HKEY_Current_USER/Software. In My code it List seven subkeys under there. Actually there are lot more and the entry i wanted to access in seen in the Registry,...
7
by: fniles | last post by:
In my case, I have registry entries with multiple Key values, like the following I would like to loop thru MyApp\MySection\Data to get to entries A,B and C, instead of doing the...
2
by: Bill Nguyen | last post by:
I ran into Excel alphanumeric data column import using ADO.NEt. Upon searching, I found this solution, but it requires edit a registry entry as follow:...
6
by: JOSII | last post by:
Getting a string of boolean value into and out of the registry is no problem. Here's the problem: Although you can place an object into the registry and retreive it, I need to place an ArrayList...
8
by: Kniffel | last post by:
hi everyone I programm an ISAPI extension with embedded Visual C++ for a Windows CE device. I try to write the network settings to the registry. I am able to write the IpAdress to the registry,...
2
by: rodpolako | last post by:
Hi everyone, I am trying to write a program that can make some changes into a windows XP registry. My program works great when it is working on the local registry. What I want to do is to be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.