Home > database >  Why doesn't my PB query data???????
Why doesn't my PB query data???????

Time:09-26

This is I clicked event:
Sle_3. Text=""
Sle_4. Text=""
Sle_5. Text=""
SELECT "bookinfo". "Numbers",
"Bookinfo". "isbn",
"Bookinfo". "the title,"
"Bookinfo". "date of publication,"
"Bookinfo". "the author"
INTO: sle_1. Text,
: sle_2 text,
: sle_3 text,
: sle_4 text,
: sle_5 text

FROM "bookinfo"
WHERE "bookinfo". "Numbers"=: sle_1. Text
;

IF sle_2. Text="" THEN
MessageBox (" Not found ", "there is no book!" )
Sle_1. Text=""
END the IF
Sle_1. Setfocus ()
Bookinfo was built my table, why ordered after the search, a pop-up is a MessageBox (" Not found ", "there is no book!" )
This statement, there is no query data to me?? My database is connected, data from the SQL import PB, where is my statement has a problem or data have what problem???????

CodePudding user response:

Don't seem to be correct grammar

CodePudding user response:

: sle_1. What is the content of the text?

CodePudding user response:

To connect to the database, debugged look at each variable assignment is correct

CodePudding user response:

Have chosen to db

CodePudding user response:

SELECT "bookinfo". "Numbers",
"Bookinfo". "isbn",
"Bookinfo". "the title,"
"Bookinfo". "date of publication,"
"Bookinfo". "the author"
Into to the variable

With a variable to sle_1. Text boxes, such as assignment

Have a try

CodePudding user response:

refer to the original poster huhu11030 response:
this is my clicked event:
Sle_3. Text=""
Sle_4. Text=""
Sle_5. Text=""
SELECT "bookinfo". "Numbers",
"Bookinfo". "isbn",
"Bookinfo". "the title,"
"Bookinfo". "date of publication,"
"Bookinfo". "the author"
INTO: sle_...


In embedded SQL semicolon (;) After writing messagebox (string (sqlca. Sqlcode), the sqlca. Sqlerrtext)
Have a look at what it prompts content first,,,

CodePudding user response:

Try the variable directly

CodePudding user response:

As the sixth floor, use messagebox first find out hints

CodePudding user response:

1, try to use variable
2, as far as possible in English field

Sle_3. Text=""
Sle_4. Text=""
Sle_5. Text=""
SELECT "bookinfo". "Numbers",
"Bookinfo". "isbn",
"Bookinfo". "the title,"
"Bookinfo". "date of publication,"
"Bookinfo". "the author"
INTO: sle_1. Text,
: sle_2 text,
: sle_3 text,
: sle_4 text,
: sle_5 text

FROM "bookinfo"
WHERE "bookinfo". "Numbers"=: sle_1. Text
;

IF sle_2. Text="" THEN
MessageBox (" Not found ", "there is no book!" )
Sle_1. Text=""
END the IF
Sle_1. Setfocus ()

CodePudding user response:

Should be ascribed to variables and then assigned to sle

CodePudding user response:

reference 5 floor xiaocaoya reply:
SELECT "bookinfo". "Numbers",
"Bookinfo". "isbn",
"Bookinfo". "the title,"
"Bookinfo". "date of publication,"
"Bookinfo". "the author"
Into to the variable

With a variable to sle_1. Text boxes, such as assignment

Try


This is ok
  • Related