Konu: OleDB Hatası Hk.
Öncelikle herkese merhaba..
Aşağıdaki kodu önceden bilgisayarımda çalıştırdığımda sorun yoktu ( yada ben öyle hatırlıyorum - başka PC de de sorunsuz çalışıyorda olabilir )
Şimdi ise şu hatayı alıyorum :
"OLE IDispatch exception code 0 from Microsoft OLE DB Service Components: Başlatma dizesi biçimi OLE DB belirtimine uymuyor..."
Sorunu nasıl düzeltebilirim.
*!* Author: Cetin Basoz
*!* Program Name: creating fixed columns in grids
#Define TESTDATALOC "C:\Program Files\Microsoft Visual FoxPro 9\Samples\Data\Tasdrade.DBC"
oForm = createobject('myForm')
oForm.Show
Read events
Define CLASS myform AS form
Top = 0
Left = 0
Height = 450
Width = 250
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
Add OBJECT hflex AS olecontrol WITH ;
Top = 0, ;
Left = 0, ;
Height = 420, ;
Width = 250, ;
Name = "Hflex", ;
OleClass = 'MSHierarchicalFlexGridLib.MSHFlexGrid'
Procedure Init
Local oRecordset,oConnection, strCn, strShp
*!* Conventional SQL joins
strCn = [Provider=MSDASQL.1;Persist Security Info=False;]+;
[Extended Properties=]+;
["DSN=Visual FoxPro Database;UID=;]+;
[SourceDB=TESTDATALOC;SourceType=DBC;]+;
[Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;"]
strShp = [select customer.cust_id, Company, orders.order_id, ]+;
[ order_date, orditems.product_id from customer ]+ ;
[ inner join orders ]+;
[ on customer.cust_id = orders.cust_id ]+;
[ inner join orditems ]+;
[ on orditems.order_id = orders.order_id ]
*!* Conventional SQL joins
oRecordset = CreateObject("adodb.recordset")
oConnection = CreateObject("adodb.connection")
With oConnection
.Provider = "MSDataShape"
.ConnectionString = strCn
.Open
Endwith
With oRecordset
.ActiveConnection = oConnection
.Source = strShp
.Open
Endwith
With this.hflex
.Datasource = oRecordset
.FixedCols = 2 && Fixed columns on left < -----------------------
.ColWidth(0,0) = 0 && Hide unused column 0 leaving only cust_id fixed
For ix = 1 to .Cols - 1
.MergeCol(ix) = .t. && Merge cols
Endfor
.Mergecells = 3
Endwith
Endproc
Procedure QueryUnLoad
Clear events
Endproc
Enddefine
Yorumlar ve yardımlar için şimdiden teşekkürler.
-------------------------------------------------------------------------------------------------------------
Hayat bir bisiklete binmek gibidir. Pedalı çevirmeye devam ettiğiniz sürece düşmezsiniz. Claude Peppeer
Kusuru söylenmeyen adam, ayıbını hüner sanır. Türk Atasözü