Discussion Locked

Connect Foxpro dbf using VB

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Dear Friends,

I am trying to open Connection for FoxPro Database. I want to Open Database dynamically. I use Following String as a connection string.

strConnectionString = "ODBC;Driver={Microsoft FoxPro Driver};SourceType=DBF;Directory=" &strFilPath

Note:- Here strFilePath is a Folder Name of Foxpro .DBF file

I also want to open DBC File types, so if you feel the connection string for DBC is different then it will be nice to get connection string idea for that too.

Waiting for your Quickest Clue.

Thanx in Advance

Mihir Gandhi

5 replies

by pxttocyob

yes it is quickest connection for open string. There is no quicker connection for open string. Could only be quicker if you change the .dbf to .stp, then it will be fast.

by fenaikh

Hi
pls read this article from MS and its links to help yu.

good luck
Mohamed

ftp://ftp.microsoft.com/developr/fox/kb/q169/4/70.txt
part of the article...

" Q. How do I enable connection pooling if the application is written in VisualBasic?
A. A Visual Basic or ODBC application can call the SQLSetEnvAttr function to
enable connection pooling. Connection pooling is a process-level attribute,
so any subsequent connection made through the ODBC driver manager in the
Visual Basic application will use connection pooling. A Visual Basic
application can use the function declaration and code to enable connection
pooling.

Declare Function SQLSetEnvAttr Lib "odbc32.dll" (ByVal henv As Long, ByVal Attribute As Long, ByVal Value As Long, ByVal StringLength As
Long) As Integer ' env attribute
Public Const SQL_ATTR_CONNECTION_POOLING = 201
Public Const SQL_ATTR_CP_MATCH = 202
' values for SQL_ATTR_CONNECTION_POOLING
Public Const SQL_CP_ONE_PER_DRIVER = 1
Public Const SQL_IS_UINTEGER = -5
nstatus = SQLSetEnvAttr(0, SQL_ATTR_CONNECTION_POOLING,
SQL_CP_ONE_PER_DRIVER, SQL_IS_UINTEGER) SQLAllocEnv...
SQLAllocConnect... SQLConnect... SQLDisConnect...
SQLFreeConnect... SQLFreeEnv...

"
more info ....

HOWTO: Enable ODBC Connection Pooling in VB ADO Application
ftp://ftp.microsoft.com/developr/fox/kb/q237/8/44.txt
Q228843 HOWTO: Implement Session Pooling from Visual Basic ADO Program
ftp://ftp.microsoft.com/developr/fox/kb/q228/8/43.txt

by mihir_gandhi

I was unable to fetch the links, but i have got the solution, as i was wrong in defining connection string. My connection string was perfact except i had written ODBC; So, I removed that and i have got the solution. But Thank you for your support.
Mihir

This discussion is closed to new replies.