If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Other PC Databases > Replace inside field in DBF database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-31-11, 10:21
diegodcl diegodcl is offline
Registered User
 
Join Date: May 2011
Posts: 1
Replace inside field in DBF database

Hi everyone!

I'm having a little trouble to input some data in my sql server database because the source files that are a DBF database that are formatted diferently in some numeric fileds. The fields contain values like 34,5 and 56,7. I need to replace these "," for "." so I don't mess up the insert on sql. I cannot do this with de code in VB (my system is in VB6 by the way) because I'm building the insert statement inside the select of the DBF. something like this.

rsdbf.open " select 'insert into table1 (campo1, campo2) values('+campo1+','+campo2)"

I need something like select 'insert into table1 (campo1, campo2) values('+replace(campo1,",",".")+','+campo2)

Thanks in advance

PS: Sorry about some gramatical errors, my english is not that good.
Reply With Quote
  #2 (permalink)  
Old 07-13-11, 09:58
jrbbldr jrbbldr is offline
Registered User
 
Join Date: Nov 2002
Posts: 92
First question: When you say that the DBF field contents are like - 34,5
How are you viewing that data?
Are you using the 'native' environment for the DBF data table or something else?

If the DBF environment is somehow set to European, where commas and decimal places are interchanged within numbers, the value may APPEAR like that, but in reality not BE that.

Or if the DBF data table field was a Character field instead of a Numeric field then it could have a comma instead of a decimal place. If this were the situation, it is easy to change with a Character or String substitution.

With some clarification we can assist you better.

Good Luck
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
Pingbacks are On
Refbacks are On