It's quite troublesome when we are maintaining some Access database that is located in remote area. Sometimes we need to change column type of some column because we had configured it improperly at the first time. Through some exploration and after trying for searching the solution for this kind of need, I found some useful information that could be beneficial for you when you have this need in the future. The solution has been tested by me on Access 97. What we need to do?
You can using DAO in VB to run this function. First is defining one DAO connection to your Access database. Second is putting the following code in your program:
(For example if you had created DAO as DB, the field will be changed is field99, currently the column type is Integer and you have to change it into Double)
DB.execute "ALTER TABLE [table name] ADD COLUMN fieldx Double"
DB.execute "UPDATE [table name] SET fieldx = field99
DB.execute "ALTER TABLE [table name] DROP COLUMN field99
DB.execute "ALTER TABLE [table name] ADD COLUMN field99 Double"
DB.execute "UPDATE [table name] SET field99 = fieldx
DB.execute "ALTER TABLE [table name] DROP COLUMN fieldx
That's all. After you have run the code, I'm sure the column type of field99 will be changed into Double.
Cheers.
Freedom to Express Your Thought and Share It for Human Dignity
Knowledge is not useful at all, unless you share it with others. Sometimes in the future the information might be important either for you or other people. This blog collects all the human thinking, knowledge and experiences, and of course it's 100% free for everyone, either just for passing by information or it could be manifested in your life.
Wednesday, October 3, 2012
How to Change Column Type in MS Access Using VB6 Programming
Wednesday, September 26, 2012
Help! My USB Flashdisk Cannot Be Formatted, Always Write Protected
After searching from google, I've found some good information that I feel it's helpful to share it to all of you. It's about unwelcome USB flash disk that got protected . I had looked for some link that give some solution for this problem. But after I've tried some solution that's suggested, actually here is quite simple way need to be taken you to clear this unintended protection.
Actually it's because of careless handling of releasing the flashdisk from computer's USB port. Somehow you don't release properly the flashdisk by going to "Safe Remove USB" shortcut. You might be forget and unplug the flashdisk from the USB Port directly before you remove it safely from the port. This careless handling can cause the flashdisk become "Write Protected". So, what is the simple solution for this problem? As suggested, we can plug the flashdisk to some computer, then right click at the flashdisk's drive, then choose "eject". Then we can unplug and replug the flashdisk back to the computer, then I'm quite sure that the flashdisk can working normally back.
See you in the next problem solving subject.
Actually it's because of careless handling of releasing the flashdisk from computer's USB port. Somehow you don't release properly the flashdisk by going to "Safe Remove USB" shortcut. You might be forget and unplug the flashdisk from the USB Port directly before you remove it safely from the port. This careless handling can cause the flashdisk become "Write Protected". So, what is the simple solution for this problem? As suggested, we can plug the flashdisk to some computer, then right click at the flashdisk's drive, then choose "eject". Then we can unplug and replug the flashdisk back to the computer, then I'm quite sure that the flashdisk can working normally back.
See you in the next problem solving subject.
Monday, September 24, 2012
How to Reset Disabled Screensaver Timer in Windows 7
Today, we have a problem of screensaver in one of our user. She cannot modify the waiting timer in the screensaver because it's disabled by the Operating System. We have checked her windows login account and it's already set as Administrator, but the timer option is still disabled! Looking some article in the internet, I've founded that we can reset this problem by going into the registry through regedit command.
To reset all of the set screensaver that you haven't created intentionally before, you might go to your windows registry by typing regedit at the run command. After you had get into the registry window, you can go and find the registry key in : [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop], then erase all of the screensaver's key and its value. I'm sure that next time when you open your screensaver personalize settings, you can set your screensaver timer back.
To reset all of the set screensaver that you haven't created intentionally before, you might go to your windows registry by typing regedit at the run command. After you had get into the registry window, you can go and find the registry key in : [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop], then erase all of the screensaver's key and its value. I'm sure that next time when you open your screensaver personalize settings, you can set your screensaver timer back.
Subscribe to:
Posts (Atom)