If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Saving Recordset To Another .mdb File

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-14-04, 05:25
amuro_ray amuro_ray is offline
Registered User
 
Join Date: Mar 2004
Posts: 4
Question Saving Recordset To Another .mdb File

I have this question

1. How To Save a recordset directly to another file than the file i use to open it ?

2. How to sort a Date in Datagrid. i get this error :
run-time error '3001'
arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

I use Date Format on the database.
And i use DTpicker to fill the value.

Thanx for the answer...
Reply With Quote
  #2 (permalink)  
Old 04-14-04, 09:06
SCIROCCO SCIROCCO is offline
Registered User
 
Join Date: Mar 2004
Location: www.scirocco.ca
Posts: 346
Re: Saving Recordset To Another .mdb File

Once you have your initial recordset, create a new connection to the second database, from there call your SQL statements using the new connection i.e.

Dim Connection1 as ADODB.Connection
Dim Connection2 as ADODB.Connection
Dim rs as ADODB.Recordset

Set Connection1 = new ADODB.Connection
Set Connection2 = new ADODB.Connection

Connection1 .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:\Test.mdb;Persist Security Info=False"

Connection1.Open

rs.Open "SELECT * FROM Table1", Connection1

Connection2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:\Test.mdb;Persist Security Info=False"

Connection2.Open

Connection2.Execute "INSERT Table2(Field1) SELECT '" & rs.Fields("Field1") & "'"

rs.Close

Connection1.Close
Connection2.Close

Set rs=Nothing
Set Connection1= Nothing
Set Connection2= Nothing
__________________
http://www.scirocco.ca/images/banner...occobanner.gif

Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

Or try our Ask An Expert service to answer any of your questions!
Reply With Quote
  #3 (permalink)  
Old 04-15-04, 07:56
amuro_ray amuro_ray is offline
Registered User
 
Join Date: Mar 2004
Posts: 4
Question Sorting Date ?

Hei Scirocco. Thanx For The Answer.

But, can you solve my prob when sorting date in datagrid ?
i got that error message., I can sort any other fields beside date.
The Format impossibly false, since i use DateTimePicker to input the data.

Any Clue Will Help....
By The Way... MSDN Doesn't Help much.

Thanx ...
Reply With Quote
  #4 (permalink)  
Old 04-15-04, 10:07
SCIROCCO SCIROCCO is offline
Registered User
 
Join Date: Mar 2004
Location: www.scirocco.ca
Posts: 346
Re: Sorting Date ?

One suggestion is to convert the DateField into an integer (I beleive there is a unique number for every date since 1900) when doing the sort and then you should be able to sort fine.
__________________
http://www.scirocco.ca/images/banner...occobanner.gif

Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

Or try our Ask An Expert service to answer any of your questions!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On