How to Use the Query in Foxpro to Visual Basic 6

85 pts.
Tags:
FoxPro
SQL Query
Visual Basic 6
i making a program that will sort or index the table in foxpro, i use sql code to generate the code in visual basic 6.0 but it has always an error.. i'm using ado data control, and here are my codes..

 

Adodc1.ConnectionString = "Provider=VFPOLEDB.1;Data Source=G:Documents and SettingsDP2205DesktopDataEnvironment;Password="";Collating Sequence=MACHINE" Adodc1.RecordSource = " SELECT Books.book_id, Books.title, Books.topic_id, Books.copyright_year, " _   & " Books.isbn_number, Books.publisher_name, Books.purchase_price," _  & " Books.covertype, Books.date_purchased, Books.pages, Books.notes" _ & " FROM books!books" _ & " ORDER BY copyright_year DESC" Adodc1.Refresh Set DataGrid1.DataSource = Adodc1

please help me get through with it,,hehe

i hope for your replies,,

 

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    More details are needed. What is the error message you are getting ? Are you able to connect to the database ?
    69,410 pointsBadges:
    report
  • Sukamichi
    error is Run time error '3001': Applicant-defined of object-defined error Arguments are of the wrong type, are out of acceptable range, or are conflict with one another Yes sir, I can connect to the database but i can't create a query on it..
    85 pointsBadges:
    report
  • carlosdl
    The error message seems to imply a call to a function or procedure using an incorrect set of parameters. The only procedure call I see in the code you posted is the call to Adodc1.Refresh, which is most likely using the ConnectionString to connect to the database and execute the query, so, if there is no more code involved the problem must be in the connection string or the query. ConnectionString is a string and as such it is defined inside double quotes, but inside it you have another pair of quotes for the password, which could be causing the error. Try removing those inner quotes. Also, since it's been about 20 years since I used FoxPro for the last time, I'm not sure if "books!books" is a correct way to reference a table.
    69,410 pointsBadges:
    report
  • Sukamichi
    thnx for the reply,,your right refresh has always a problem,, the qoutes in the password indicate that there is no password,, and the books!books come form the foxpro its self,,i made a query in the foxpro and copy it to the vb6,,so i think its not the problem,, i hope for more recommendation,, thnx again for your time sir,,
    85 pointsBadges:
    report
  • carlosdl
    I know the quotes in the password indicate that there is no password, but if you are including a double quoted string inside another string, you usually need to escape the inner quotes. Did you try my suggestion of removing those inner quotes ? Something like this: Adodc1.ConnectionString = "Provider=VFPOLEDB.1;Data Source=G:\Documents and Settings\DP2205\Desktop\DataEnvironment;Password=;Collating Sequence=MACHINE" Also, make sure the data source (and its path) is correct.
    69,410 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following