| |

VerySource

 Forgot password?
 Register
Search
View: 1639|Reply: 9

Database properties

[Copy link]

1

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-3-23 09:30:02
| Show all posts |Read mode
Excuse me:
   Question 1: How can I display database comments using the 2.prg program?
For example: a note added by the database: "This database is used to manage employee salaries" How to display this database note with a program?
    
   Question 2: I have established the three tables A.DBF, B.DBF, and C.DBF. The relationship between A and B is one-to-one, and B and C are many-to-one. "Is a normal index, B is the main index. After I set the referential integrity of B and C to" Update Rules "to" Cascade ", when I modify any" name "record in B.dbf, an error message pops up" Trigger "failed.

Please enlighten me, thank you
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-7-2 12:15:01
| Show all posts
1.DBGETPROP (database name, "DATABASE", "Comment")

2. Refer to:

The "Rules for Updating" tab in the "Reference Integrity" (RI) builder specifies the rules to be applied when modifying key values ​​in the parent table.

Cascade

Changes in the value of the primary or alternate keyword field in the specified parent table are reflected in the related child table. If this option is selected, any changes made to those fields in the parent table at any time, Microsoft Visual FoxPro will automatically change the corresponding values ​​in all related child table records.
Restrict

Prevent the modification of the value of the primary or alternate keyword field in the parent table, so no orphaned records will appear in the child table.

Ignore
Ability to update records in the parent table, even if there are related records in the child table.
Reply

Use magic Report

0

Threads

18

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 Singapore

Post time: 2020-7-12 00:45:01
| Show all posts
1.DBGETPROP(Database name, "DATABASE", "Comment")

The answer upstairs is correct.

2. If you are not familiar with VFP triggers, it is better to use less.

  A <-> C one to one
  C => B one-to-many

  Such a setting will make VFP any time you try to modify the record in B
Database code to check the records in C, if the content of the modified name does not exist in C
It will naturally fail.

  If you want to see the problem, expand the database, open Store Procedure, and then
Trace where the trigger code is to see what went wrong.
Reply

Use magic Report

1

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-7-18 08:45:01
| Show all posts
Can you tell me dbgetprop(database name, "database", "Comment") with an example to explain the usage of this command?
First, I don't know what the "database name" is, where is it established? Which is its name? Please enlighten me from experts, I am new to VFP
Second, "database" is also a database. What is the difference between it and the database name?
Third, what does the "Comment" command refer to?
Can you please give me a practical example?

Thank you
Reply

Use magic Report

1

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-7-18 10:00:01
| Show all posts
Excuse me, why I put the database name: 3.dbc
dbgetprop(3.dbc,"database","Comment") The system displays an error message "The function name is missing"
Please enlighten me from experts
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-7-19 09:00:01
| Show all posts
Database to open

Give it a try:

dbgetprop("3.dbc","database","Comment")
Reply

Use magic Report

0

Threads

18

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 Singapore

Post time: 2020-7-19 16:00:02
| Show all posts
Can you tell me dbgetprop(database name, "database", "Comment") with an example to explain the usage of this command?
First, I don't know what the "database name" is, where is it established? Which is its name? Please enlighten me from experts, I am new to VFP
Second, "database" is also a database. What is the difference between it and the database name?
Third, what does the "Comment" command refer to?
-------------------------------------------------- --------------------------------
The database name is its name. After you create a database, such as: abcde.dbc //Note that it is a DBC file
Then the name of your database is: abcde, if the current database is open, then use the following command
Get the relevant notes of the database.

?dbgetprop("abcde","database","Comment")
-------------------------------------------------- --------------------------------
Database is not a database, it is a word, concept, name, no entity.
-------------------------------------------------- --------------------------------
Comment is not a command, here is a parameter, which means that what I want is a comment.
Reply

Use magic Report

1

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-7-20 12:15:01
| Show all posts
Well, this comment can be displayed on the screen, but the result I want is to run ------dbgetprop("abcde","database","Comment") to pop up a window, the name of the window is: " Display abcde database comment", and then the comment parameter in Comment is displayed below. There are three options of "terminate", "retry" and "ignore" below the window.

How do you master the pop-up window?
Reply

Use magic Report

0

Threads

18

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 Singapore

Post time: 2020-7-20 18:30:01
| Show all posts
This thing does not have much practical meaning, and if you study, you should read more books. These problems
It is something that is easy to understand, just read a book.

MessageBox(("abcde","database","Comment"),2+32,"Display abcde database comment")
Reply

Use magic Report

1

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-7-21 02:15:02
| Show all posts
Ha...Thank you. After reading the book, I feel that it is really as you said. I didn't expect books to be so useful before. They are all practical exercises. Alas...It was a waste of time, thank you! !
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list