Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADO Shape problem
Message
 
À
15/04/2005 04:45:39
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Oracle
Divers
Thread ID:
01004899
Message ID:
01005057
Vues:
16
Hi Cetin,

The code snippet works in MSSQL (with the change in the connection string of course). But when I try it with Oracle, that's when it fails. I actually just had the Oracle connection string working without errors yesterday.

I'll try your suggestion and also try the tool than Terry indicated.

Thanks,
Arriyel

>>Hi,
>>
>>I have the following code to create an ADO Shape recordset. Everything is well until it tries to create the recordset. I keep getting a 'table or view does not exist' error message. Code below is the simplified version I use to make sure that the recordset gets created.
>>
>>oConnect = CREATEOBJECT('adodb.connection')
>>
>>oConnect.ConnectionString = ;
>"Provider=MSDataShape.1;Persist Security Info=False;"+;
>"Data Provider=OraOLEDB.Oracle.1;"+;
>"Data Source=DEMO;User ID=moad_test;Password=moad_test;PLSQLRSet=true"
>>
>>oConnect.Open
>>
>>oRecH = CREATEOBJECT('veRecHandler')   && class we use for record handler
>>
>>lcSqlCmd = 'SHAPE {SELECT * FROM "MyTable"} AS TestTable'
>>oResultRS = oRecH.InitRecordSet(3, 3, 3, lcSqlCmd, oConnect)
>>oResultRS.Close()
>>
>>
>>Any help is greatly appreciated.
>>
>>Thanks,
>>Arriyel
>
>Arriyel,
>Shape syntax looks fairly legal to me (for a single table or relations you might try alternative like:
>SHAPE TABLE MyTable) - with MSSQL server "MyTable" might be the culprit depending on settings and instead [MyTable] works.
>Try using without a shape syntax and provider first. If it works this might help to see the results quickly:
>
>TESTDATALOC = _samples+"data\testdata.DBC"
>Local strCn,strShp
>strCn =	[Provider=MSDataShape;Persist Security Info=False;]+;
>  [Data Source=]+TESTDATALOC+[;Data Provider=VFPOLEDB]
>strShp = 'Shape Table customer'
>
>TestADO(strCn,strShp)
>
>Function TestADO(tcConn, tcSQL)
>  Local oRecordset As "adodb.recordset",oConnection As "adodb.connection"
>  oRecordset = Createobject("adodb.recordset")
>  oConnection = Createobject("adodb.connection")
>
>  With oConnection
>    .ConnectionString = m.tcConn
>    .Open
>  Endwith
>
>  With oRecordset
>    .ActiveConnection = oConnection
>    .Source = m.tcSQL
>    .Open
>  Endwith
>  ShowMe(oRecordset)
>Endfunc
>
>Function ShowMe
>  Lparameters toRecordset
>  oForm = Createobject('myForm', toRecordset)
>  oForm.Show
>  Read Events
>Endfunc
>
>Define Class myform As Form
>  Height = 450
>  Width = 750
>  Name = "Form1"
>
>  Add Object hflex As OleControl With ;
>    Top = 10, Left = 10, Height = 430, Width = 730, Name = "Hflex", ;
>    OleClass = 'MSHierarchicalFlexGridLib.MSHFlexGrid'
>
>  Procedure Init
>    Lparameters toRecordset
>    With This.hflex
>      .FixedCols = 0
>      .Datasource = toRecordset
>      .AllowUSerResizing = 3
>      .CollapseAll
>    Endwith
>
>  Endproc
>  Procedure QueryUnload
>    Clear Events
>  Endproc
>Enddefine
>
Cetin
Speak using soft and sweet words in case you have to eat them later.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform