| |

VerySource

 Forgot password?
 Register
Search
View: 900|Reply: 8

I encountered several problems while doing the database, please help

[Copy link]

4

Threads

13

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-1-19 17:00:01
| Show all posts |Read mode
1\How to convert a string into a time class?

I use the following to change the date
Format (CDate (txtvalue.Text), "yyyy-mm-dd")

But turn time
Format (CTime (txtvalue.Text), "hh: mm: ss")

Looks like there is no ctime function


2\I now have an mdb database named default. There is a table of "test records" ...
Then I wrote this program
Dim conn As New ADODB.Connection
Dim rs_data1 As New ADODB.Recordset
Dim connectionstring As String
connectionstring = "provider = Microsoft.Jet.oledb.4.0; data source = default.mdb"
conn.Open connectionstring
rs_temp.CursorLocation = adUseClient
rs_temp.Open sql, conn, adOpenKeyset, adLockPessimistic

Now the data record is in re_temp ... but how to make the searched record into a table in default?

Thank you all in advance!
Reply

Use magic Report

4

Threads

13

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

 Author| Post time: 2020-1-27 09:36:02
| Show all posts
The first issue has been resolved:
Format (CDate (txtvalue.Text), "hh: mm: ss")
You can also use cdate ... haha ​​... I found a good dish
Reply

Use magic Report

4

Threads

13

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

 Author| Post time: 2020-1-29 23:54:01
| Show all posts
Nobody know?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-1 02:27:01
| Show all posts
It is best to add a judgment if isdate (format (txtvalue.text), "yyyy-mm-dd") = true then whether it is a date format
.
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-2-1 16:27:01
| Show all posts
The second problem I have encountered before, we can quit and think about it. In the program, we do not use the program to create. Then we create a new table to process or release the records you searched out: "But it will trouble you. Multi-connection data sheet:
Reply

Use magic Report

4

Threads

13

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

 Author| Post time: 2020-2-6 22:30:01
| Show all posts
Does the upstairs mean that the table is created manually in access?
Reply

Use magic Report

1

Threads

21

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 Great Britain

Post time: 2020-2-7 19:30:01
| Show all posts
It's no different from handmade
Just use the code to create a table in the default, and then write line by line.

But what tools should access do for this?
Reply

Use magic Report

0

Threads

21

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-2-11 18:15:02
| Show all posts
You can directly execute a SQL statement.
Insert Into [table1] Select [Columns] from [table2]
or
Select [Columns] From [table1] Into [table2]
Reply

Use magic Report

1

Threads

9

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-2-12 21:30:01
| Show all posts
To manually create a table in access and then execute the insert statement in the code, this is the idea, check the syntax specifically.
Generally for tables and other things, it is still built in the database. The functions completed by the program are add, delete, and modify. Tables are not normally created in the program.
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