Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 12th, 2006, 01:20 PM
Registered User
 
Join Date: Jun 2006
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to scubasteve
Default Changing table field types in VB

I have a XML data file I receive that comes into Access 2003. All the fields are defined as Text, however, there are two fields that need to be Number/Double. There is no way I am going to be able to have the XML file changed. Is there some way through VB code to change the data type on this table on the fly through calling the code in a macro? I don't want to have to stop and change the data types manually.

Thank you.

Neil

Neil
Reply With Quote
  #2 (permalink)  
Old June 12th, 2006, 01:24 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

I have a similar thing that I need to do.

My work around is as follows.

I declare ADODB Connection called cn and then

Code:
strSQL = "ALTER TABLE " & strTableName & " ALTER COLUMN [Allocation Amount] CURRENCY"

cn.Execute strSQL
That changes the datatype from a string to currency, and I would assumed that you could change it to a Number or Double just as easily.


Mike
EchoVue.com
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
changing rs.field to records gilgalbiblewheel Classic ASP Databases 1 June 22nd, 2007 11:40 PM
MySQL table types madhukp PHP Databases 1 December 16th, 2004 03:44 PM
Single and Double data types in vb Luke24 Beginning VB 6 1 November 1st, 2004 03:06 PM
BLOB field file types kend SQL Server ASP 0 December 19th, 2003 02:45 PM



All times are GMT -4. The time now is 09:19 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.