fail to connect vfp odbc

A

Agnes

(1)Session("ConnectionAuth") = "Provider = VfpOleDB.1;Data Source =
d:\cgl\vfpmaster\ttsdata\tts.dbc"
(2)Dim authConnection As New
SqlConnection(Session("ConnectionAuth").ToString())
There is an error in statment(2) , it said invalid ' provider'

tts.dbc is my vfp database which located in my D drive. How can I connect my
vfp database ??
thanks in advance
 
A

Agnes

I change by sqlconnection into OLE dbconnection.
Session("ConnectionAuth") = "Provider = VfpOleDB.1;Data Source =
d:\cgl\vfpmaster\ttsdata\tts.dbc"

Dim authConnection As New
OleDbConnection(Session("ConnectionAuth").ToString())
Dim authCommand As String = "select loginid from coinfo
where loginid = @cocode "
Dim oleCommand As New OleDbCommand(authCommand,
authConnection)

oleCommand.Parameters.Add(New OleDbParameter("@cocode", 10))
oleCommand.Parameters("@cocode").Value = UserName
oleCommand.Parameters.Add(New OleDbParameter("@pwd", 50))
oleCommand.Parameters("@pwd").Value = UserPassword
authConnection.Open() <-- error

Error "'VfpOleDB.1' ´£¨ÑªÌ¨Ã¥¼µn¿ý©ó¥»¾÷¹q¸£¤W¡C" String
for english version it said [the user didn't login the machine| (Any thing
wrong in my session|") ??
thnaks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,017
Latest member
GreenAcreCBDGummiesReview

Latest Threads

Top