473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

ASP connection to visual foxpro

I am trying to setup an active server page that accesses my visual
foxpro database. I have setup a system DSN named vfp_test. How do you
open a recordset in an ASP? I have tried this code: rs.Open "ICILOC",
"DSN=VFP_test" , but I get an error on that line.
Oct 22 '08 #1
1 3101
ja****@aol.com wrote:
I am trying to setup an active server page that accesses my visual
foxpro database. I have setup a system DSN named vfp_test. How do you
open a recordset in an ASP? I have tried this code: rs.Open "ICILOC",
"DSN=VFP_test" , but I get an error on that line.
First, create and open a connection object:
set cn=createobject("adodb.connection")
'if vfp has an native ole db provider you should use it
'see www.connectionstrings .com
'for the sake of this example I will use your DSN
cn.open "VFP_test"

Then create a sql statement to only retrieve the fields you plan to use from
iciloc which I assume is the name of the table.
sql="select filed1,...,fieldN from iciloc"

Be explicit - don't use selstar in production code:
http://www.aspfaq.com/show.asp?id=2096

Then, to open a recordset using the default server-side, forwardonly cursor:
set rs = cn.execute(sql,,1)

The 1 means adCmdText - you should always tell ADo what the command type is.

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Oct 22 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: mohammad.gh | last post by:
hi, I have an ASP page that is connected to a DBF file and it works right on my local server ( XP professional) but when i publish it in my internet server, i get this error: --------------------...
2
by: Kshitij | last post by:
HI, How to connect to the dBase database?? One option is to create a DSN and use it.But I want to do it in some other way like just passing a connection string or like that. Thanks in advance.
9
by: Dr. Know | last post by:
Greetings, I am running IIS on W2kServer and am trying to use ASP with some legacy X-Base tables. I cannot get the provider to connect. Relevant code is: strProvider =...
1
by: GPBSOFT | last post by:
I am Italian developer, escuse me for my bad English I have a problem with ODBC. I must link to a database from Visual FoxPro, I have installed Windows XP Professional with service pack 2. When I...
8
by: John Smith | last post by:
How do I connect to a FoxPro 7 database?
3
by: Amar | last post by:
I have a abc.PRG file in visual foxpro 8.0. I can run this file using visual foxpro environment and it creates a table X.dbf in the same folder where this program file is and populates some data in...
6
by: JimmyKoolPantz | last post by:
I have been given the task of converting a program from VFP (visual foxpro) to Visual Basic.net. My question is "Is it possible to generate a DBF file Dynamically(at runtime) using Visual...
0
by: diston52 | last post by:
Hello,,, I'm Don I'm currently working on a system to track contacts for a railroad in a nearby town. I am using Visual Studio 2005 and SQL Server Express. The client has purchased a package...
3
by: HistoricVFP | last post by:
Hello, I’ve been given the task of importing .dbf files from a very old version of Visual FoxPro (version 2.1) into Access (2003). When I import the data straight to Access it errors with: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.