Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Download data with ADO through VB from Oracle to Sql Server
Message
De
22/05/2003 08:58:45
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Contrôles ActiveX
Titre:
Download data with ADO through VB from Oracle to Sql Server
Divers
Thread ID:
00791551
Message ID:
00791551
Vues:
54
The following code is supposed to fetch data from Oracle
and trf the same into SQL Server. This query - works in
SQL Plus - but when called thru the ADO DC connection -
the same returns 0 values for numeric entities - Can
someone provide some explanation ???

Private Sub Command1_Click()
' On Error GoTo COMMAND1_ERROR
' FSO.CreateTextFile "C:\Documents and
Settings\Administrator\Desktop\ERROR.TXT", True
' Set TS = FSO.OpenTextFile("C:\Documents and
Settings\Administrator\Desktop\ERROR.TXT", ForWriting)
rs_sql.Open "select max(deal_transaction_date) from
deals", cn_sql
If rs_sql.BOF = True And rs_sql.EOF = True Then
MsgBox "Max Date not found.."
Else
If IsNull(rs_sql(0)) = True Then
sql_text = "select
DEAL_ID,deal_Ref,STATUS,pricing_status,BRANCH_CODE,CUSTOMER
_ID,DEAL_TRANSACTION_DATE,DEAL_VALUE_DATE," _

& "DEAL_QTY,DEAL_QTY_OUNCES,DELIVERED_QTY,METAL_RATE_CLIENT
,PREMIUM_CLIENT,METAL_AMT_CLIENT,AVERAGE_FX_RATE_CLIENT," _

& "METAL_AMT_SUPPLIER_INR,METAL_AMT_CLIENT_INR,CHARGED_COMM
ISSION,COMMISSION_INCOME_REGULAR,CUSTOMS_DUTY,OCTROI_DUTY,"
_

& "SALESTAX_RATE,SALESTAX,invoice_value,BOOKING_MARGIN,REMA
RKS,DEAL_ENTRY_TIME,DEALER,DEAL_AUTHORIZED_TIME,DEAL_AUTHOR
IZED_BY " _
& "from metagrid.deals where status <>'C' and
(pricing_status ='P' or (pricing_status ='F' and
deal_qty>delivered_qty))"
Else
vdeal_transaction_date = Format(rs_sql
(0), "MM/dd/yyyy")
' MsgBox vdeal_transaction_date
sql_text = "select
DEAL_ID,deal_Ref,STATUS,pricing_status,BRANCH_CODE,CUSTOMER
_ID,DEAL_TRANSACTION_DATE,DEAL_VALUE_DATE," _

& "DEAL_QTY,DEAL_QTY_OUNCES,DELIVERED_QTY,METAL_RATE_CLIENT
,PREMIUM_CLIENT,METAL_AMT_CLIENT,AVERAGE_FX_RATE_CLIENT," _

& "METAL_AMT_SUPPLIER_INR,METAL_AMT_CLIENT_INR,CHARGED_COMM
ISSION,COMMISSION_INCOME_REGULAR,CUSTOMS_DUTY,OCTROI_DUTY,"
_

& "SALESTAX_RATE,SALESTAX,invoice_value,BOOKING_MARGIN,REMA
RKS,DEAL_ENTRY_TIME,DEALER,DEAL_AUTHORIZED_TIME,DEAL_AUTHOR
IZED_BY " _
& "from metagrid.deals where status <>'C' and
(pricing_status ='P' or (pricing_status ='F' and
deal_qty>delivered_qty)) " _
& "and DEAL_TRANSACTION_DATE > to_date('" &
vdeal_transaction_date & "','mm/dd/yyyy')"
End If
End If
rs_sql.Close

Appreciate if u can help !!
.
Répondre
Fil
Voir

Click here to load this message in the networking platform