PDA

View Full Version : استفاده از ADODB.Command



صنم
شنبه 23 مهر 1384, 11:17 صبح
سلام
من برای query گرفتن از جدولم از adodb.command استفاده کرده ام ولی تا یک حدی از string را می تواند در خودش نگهداری کند و چون query من طولانی است جواب نمی دهد به نظر شما باید چی کار کنم کد را ضمیمه کرده ام
Dim rst1 As New ADODB.Recordset
Dim cmd1 As New ADODB.Command
Set con1 = New ADODB.Connection
Set cmd1 = New ADODB.Command
Set rst1 = New ADODB.Recordset
con1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db\db" & Trim(tyear) + ".mdb" & ";Persist Security Info=False"
cmd1.CommandText = "select * from village_off where ((sal='" & Trim(Text1.Text) & "') and ((mah='" & Trim("ÝÑæÑÏíä") & "')or(mah='" & Trim("ÇÑÏíÈåÔÊ") & "')or (mah='" & Trim("ÎÑÏÇÏ") & "')) and (name_shabakeh='" & Trim(t2) & "') and (name_shahr='" & Trim(t3) & "')and (name_village=" & (t4) & ") and (name_arkaze_behdashti_darmani=" & (t5) & ")and (population=" & Trim(t6) & ")and (total_water=" & Trim(t7) & ") and (begsazi_water=" & Trim(t8) & ") and (total_mikrobi=" & Trim(t9) & ") and (namatloub_mikrobi=" & Trim(t10) & ") and (chemical=" & Trim(t11) & ") and (num_home_boil_water=" & Trim(t12) & ") and (total_home_mother_clr='" & Trim(t13) & "') and (total_mother_clr=" & Trim(t14) & ") and (zero_mother_clr=" & Trim(t15) & ") and (other_mother_clr=" & Trim(t16) & ") )"