Re: how to change decimal symbol in VB / Access?



gaI tried the CODE you sugested but result wasn't such as i expected...
insted of "5.882" i recivded "0.006" :(

MAYBE THERE'S OTHER WAYS TO DO IT, PLS SOMEONE HELP!!!

PS> that's right TIM, some of the code wasn't real, becouse the real code is
much more longer, but i have headache only about this part, so i have to
corect it a bit

"Tim Ferguson" wrote:

> =?Utf-8?B?TWFyaXNC?= <MarisB@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
> news:3F3898B2-119B-44AB-B913-207425046EA3@xxxxxxxxxxxxx:
>
> > Dim tBillNo, tVIN as string
>
> Please note: tBillNo is dimmed as a Variant not as a string
>
> > Dim t_totSUM as double
>
> string and double has a lower case letters, so I assume that this is not
> real code
>
> > tBillNo="CF4354545645"
>
> > tVIN="H200MMM"
>
> > t_totSUM=100/17
>
> > inSQL = "INSERT INTO table 1 (BillNo, VIN, totSUM)" & _
> > "SELECT '" & tBillNo & "', '" & tVIN & "', " & t_totSUM
>
> there is no space between the parts, therefore inSQL looks like
> "...totSum)SELECT..."
>
> t_totSUM is dimmed as a double, so you are asking for it to be coerced
> into a string without specifying a format. This is not a reasonable thing
> to do: databases and their libraries (i.e. Jet, SQL S, ADO, DAO etc) have
> to work independently of regional settings, otherwise it would be
> impossible to program them for international use. Therefore, you have to
> control all conversions of numbers and dates explicitly. I have not
> looked specifically, but I'd bet good money that SQL Server and ADO both
> expect american-type numbers with a dot for a decimal separator.
>
> You rally need to do something like
>
> Dim t_totSUM As String
>
> t_totSUM = Format(100/17, "0\.000")
>
> .... the backslash forces the use of a dot rather than whatever OLEAUT32
> thinks would look nice.
>
> Hope that helps
>
>
> Tim F
>
>
>
>
> > Set inRS = CreateObject("ADODB.Recordset")
> > inRS.Open inSQL, inCON, adOpenStatic
> >
>
>
.



Relevant Pages

  • Re: Data from web site
    ... Thanks Tim, don't think I need to try that now:) ... >> I'm not clued up on HTML, but hopefully that is the name of the frame I ... >>> You can then parse out the info from the returned string. ... >>> Dim objShell As Object, objShellWindows As Object, o As Object ...
    (microsoft.public.excel.programming)
  • Re: I need help
    ... fscanfwith the "%s" option reads a white-space delimited string. ... You must check the result of the fscanf() function. ... This isn't your real code, ... If you want to return an int, ...
    (comp.lang.c)
  • Re: Catch-A-Call
    ... aka Kuay Tim ... Any higher value extends the time the modem waits ... > This string has two AT commands. ... In the Extra Settings box, ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: replacing text in textfile
    ... Thank you again Tim for they reply. ... >> Public Function ReplaceText(CleanThis As String, ... >> 'This adds a space before and after NewText ... > This is pretty wanton inserting and removing white space, ...
    (microsoft.public.access.modulesdaovba)
  • Re: Open e-mail attachment
    ... Tim, first you need to save the attchment to the file system. ... ByVal lpFile As String, ByVal lpParameters As String, _ ... Michael Bauer - MVP Outlook ...
    (microsoft.public.outlook.program_vba)