Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create views using ADO (cursoradapter)
Message
From
18/10/2004 12:39:08
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00952249
Message ID:
00952325
Views:
8
Hi Mark,

We are trying to create a SqlHelper class (similar to the asp.net sample) that we will use to create a dll using Ado. It will help us create a better upgrade path to .net by taking this intermediate step.

The problem I have is very vague. While I can create and query the new created view in one machine, I can't make it to work on any other machine. The error is that one of the OLE objects (AdoDb.Connection or Adodb.Command) is invalid. I have a related post with a sample code but when I copied and pasted the code from the post, it isn't properly formatted.

Would you mind if I email it to you and check it when you have time?



>OIC. What kind of error message are you getting? Do you really need to use a CA for this?
>
>>Hi Mark,
>>
>>Thank you for the prompt reply. I've already downloaded your CA builder a while back. However, I need to create these views on the fly and on the backend or datasource.
>>
>>I was hoping to be able to use the Ado Command object in conjuctions with the cursoradapter.
>>
>>My problem is that, I can run this codes from the command line without problem on my local machine but will break on any other machine. I created a virtual Pc and got the same error. Convert back the expanded ADO names.
>>
>>
>>Assuming: database: DATA2.DBC exists with a table called WH.DBF (WID i, WNAME C(10))
>>oConn = createobj('AdoDb.Connection')
>>oConn.ConnectionString = "Provider=VFPOLEDB.1;Data Source=data2.dbc;Password='';Collating Sequence=MACHINE;"
>>oConn.Open()
>>
>>oCmd = createobj('AdoDb.Command')
>>oCmd.ActiveConnection = oConn
>>oCmd.CommandText = "create view vw_wh as select wid,wname from wh"
>>oCmd.Execute()
>>
>>
>>>>Hi all,
>>>>
>>>>How do I create a persistent view in the datasource using ADO with CursorAdapter?
>>>
>>>You mean like a CA class that you can just add to the DE of a form without having to use the builder every time? If so, get my CABuilder and run it against your database. It will create a class lib with a CA class for every table in your DB whether it is a DBC, SQL Server DB, or Oracle schema. Just read all the comments near the top of the CABuilder PRG file.
>>>
>>>Click on the FoxPro Tools link at http://www.mctweedle.com to download. It is totally free. I will be posting a new builder for VFP9 soon.
ramil
~~ learning to stand still
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform