|
-
December 2nd, 1999, 03:51 AM
#1
records to clipboard
I have to copy a record from a recordset to the clipboard.
Anyone can help me?
Thanks.
Something over there is coding....
... and you don't know!
-
December 2nd, 1999, 05:54 PM
#2
Re: records to clipboard
try this - this bit will retrive a query to a clip board - hope it help.
(accsess data base)
Private Sub Form_Load()
Dim Db As Database
Dim Rec As Recordset
Set Db = DBEngine.Workspaces(0).OpenDatabase("c:\mydatabase.mdb")
Set Rec = Db.OpenRecordset("SELECT statment", dbOpenDynaset)
Clipboard.SetText (Rec.Fields("QueryResult").Value)
End Sub
-
February 22nd, 2000, 06:46 PM
#3
Re: records to clipboard
what is "QueryResult"?
VB wants an index and using an index it copy only a single field not the entire record.
I don't understand, so please be more specific thanks.
Something over there is coding....
... and you don't know!
-
February 23rd, 2000, 09:03 AM
#4
Re: records to clipboard
Using ADO
dim cnn as ADODB.connection
dim ars as ADODB.recordset
set cnn = new ADODB.Connection
With cnn
.ConnectionString = whatever
.Open
End With
set ars = cnn.Execute("select code from mytable")
Clipboard.Clear
Clipboard.SetText (ars!code)
This will put the first code returned by the recordset onto the clipboard
The same method can easily be ported to RDO or DAO
Hope his helps
Tony
-
February 24th, 2000, 04:10 AM
#5
Re: records to clipboard
I always use DAO, so i'll try it.
Thanx
Something over there is coding....
... and you don't know!
-
February 24th, 2000, 05:15 AM
#6
Re: records to clipboard
You could write out the whole recordset in a predefined format and write the whole thing as data to clipboard and then read back as data, and unparse it.
What else, XML is the BEST for this.
RK
-
February 24th, 2000, 05:23 AM
#7
Re: records to clipboard
IMHO the best way to do this is the GetString method in ADO (equivalent to RDO's GetClipString).
from the docs:
"Returns the Recordset as a string-valued Variant (BSTR)."
clipboard.settext rst.GetString(adClipString)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|