VC database DAO use

Updated on technology 2024-03-21
5 answers
  1. Anonymous users2024-02-07

    What language do you speak?

    This one is VC++.

    *You're talking about MFC's database access class - class cdaodatabase, which does have two member functions, create() and open(), but the function of the former is to create a new database file, and it can only be an access file (*.).mdb), only open() is able to connect to an existing SQL database file.

    Connection Sample:

    cdaodatabase dbsql();The parentheses must be there because it has a reference parameter that targets an object of class cdaoworkspace, which defaults to null

    cstring strdbpath(""This parameter is empty when the SQL connection is made, and the file path is used when the connection is access.

    cstring strdbconn("driver=;server=mysqlserver; uid=myusername;pwd=mypassword;database=Your SQL database file" )

    This parameter is set when connecting to SQL, and this parameter is left blank when connecting to access.

    strdbpath,false, false,strdbconn

    *Also, as mentioned upstairs, DAOs were originally designed for access. A data source is simply an adapter that allows the DAO to extend its functionality to connect to other databases. It is recommended to use ADO instead, which is very functional and easy to use.

    ADO uses COM component technology, which provides a completely platform-agnostic library of classes. In other words, MFC can be used in different development environments and development languages.

  2. Anonymous users2024-02-06

    Using ASP to connect to MS SQL database, the following connection string is commonly used for standard connections:

    provider=;"&

    password='"pass_word&"'

    persist security info=true;"&"user id='"user_id&"'

    initial catalog='"db&"'

    data source='"data_source&"'

    Description: provider=; Database provider, the following 1 is to represent the version information, if there is no one, the current latest version of the feature will be fully used.

    user id=sql account, the account of the database.

    password=SQL account password, the password of the database account.

    initial catalog = database name (only name, while access is a specific data file with a path).

    data source = data source, SQL server name, or its IP, usually IP

  3. Anonymous users2024-02-05

    If you declare a class that automatically calls the constructor on Windows...

    Each program must have a winmain function. Since WinMain for Windows is an entry function, it is necessary.

    Since the winmain function is also required. MFC Windows program, it's not every Windows program added to the header file of the WinMain function, that's not great-grandmother turned around.

    The console calls maincrtstartupup, and calls main

    Calling winmaincrtstartup calls winmain in the graphical user interface

    ifndef debug

    Invalid apientry with extern "c" winmaincrtstartup().

  4. Anonymous users2024-02-04

    DAO is Data Access Object, data access: hence the name suggests, it is to deal with databases. Sandwiched between business logic and database resources.

    The DAO pattern is described in the core J2EE schema as follows: in order to build a robust J2EE application, all access to the data source should be abstractly encapsulated in a public API. In programming language, this is to build an interface that defines all the transaction methods that will be used in the application.

    In this application, the distributor uses this interface when it needs to interact with the data source, and writes a separate class to implement the interface, which logically corresponds to the specific data store for selling.

    A DAO (Data Access Object) is an application programming interface (API) that exists in Microsoft's Visual Basic, a pure spine that allows programmers to request access to Microsoft's Access database. DAO is Microsoft's first object-oriented database interface. The DAO object encloses the jet function of access.

    It also has access to other Structured Query Language (SQL) databases through the JET function.

  5. Anonymous users2024-02-03

    It does not expose the structure of the database, it is relatively safe, and the SQL statements are placed separately in the DAO, and the structure of the project is clear.

Related questions
9 answers2024-03-21

In the first step, let's conduct a preliminary search on this topic. We've determined that its keywords should be"zinc infant growth", enter it into the query box, and press the go key to search. A total of 492 articles were published. >>>More

3 answers2024-03-21

At least the basic things must be mastered, such as: the linear structure of the database, the storage method, the way to call Hezheng, and the operation of the table in the database (to use statements to erect the bench to achieve). >>>More

6 answers2024-03-21

The prospect of learning UI is good, and there are many training institutions, so the local people may choose to visit and understand the real teachers and educational strength of the school before making a choice. Share the general development of the UI, I hope it will be useful to you. >>>More

11 answers2024-03-21

The deletion operation in the data is irreparable, sometimes the data in the data table may be deleted due to misoperation, or the database crashes for other reasons, and all the data is lost, especially when there is a large amount of useful data in the database, then it is impossible for you to enter the data again from the beginning, this is the role of the backup database, back up the database, when the above situation occurs, you can restore the previous database through the backup file.

6 answers2024-03-21

The structure of the storage is the main basis for classifying the types of copy databases. In today's Internet, databases are usually divided into two categories, namely relational and non-relational databases. >>>More