从单元格中获取值
Getting the value from cell
我想从 Range("C6") 中获取值 (T28200006)。
我收到这个错误:
Public Sub INFO_PROTO1(ByRef strQ As String)
Dim RECSET As New ADODB.Recordset, numero_de_police
If Len(numero_de_police) > 0 Then
RECSET.Open " select sousc.is_produit as b_perf_cma from db_dossier sousc,db_produit prod, db_protocole proto" & _
" where sousc.no_police = " & numero_de_police & " and sousc.cd_dossier = 'SOUSC' and " & _
" sousc.lp_etat_doss not in ('ANNUL','A30','IMPAY') and sousc.is_produit = prod.is_produit ", cnn_Pegase, adOpenDynamic, adLockBatchOptimistic
With Worksheets("1 - Feuille de Suivi Commercial").Range("Calcul_CMA_Origine")
您的查询值不是数字,因此您需要在 SQL:
中引用它
..." where sousc.no_police = '" & numero_de_police & "' and...
我想从 Range("C6") 中获取值 (T28200006)。
我收到这个错误:
Public Sub INFO_PROTO1(ByRef strQ As String)
Dim RECSET As New ADODB.Recordset, numero_de_police
If Len(numero_de_police) > 0 Then
RECSET.Open " select sousc.is_produit as b_perf_cma from db_dossier sousc,db_produit prod, db_protocole proto" & _
" where sousc.no_police = " & numero_de_police & " and sousc.cd_dossier = 'SOUSC' and " & _
" sousc.lp_etat_doss not in ('ANNUL','A30','IMPAY') and sousc.is_produit = prod.is_produit ", cnn_Pegase, adOpenDynamic, adLockBatchOptimistic
With Worksheets("1 - Feuille de Suivi Commercial").Range("Calcul_CMA_Origine")
您的查询值不是数字,因此您需要在 SQL:
中引用它..." where sousc.no_police = '" & numero_de_police & "' and...