> Dim Rs As New ADODB.Recordset
> Dim Str As String
>
> Str = "Select * From Table1; Select * From Tabel2"
>
> With Rs
> .CursorLocation = adUseClient
> .LockType = adLockPessimistic
> .Open
> End With
> At the open line it gives me an error "Charachters found after
>Select Statement"
You can't do multiple select in 1 statement. One recordset contains 1 query. 1 query is "Select * From Table1"
Also, you have to put your query on your Open statement ( .Open Str).
>Also Can I add a RichTextBox at runtime with the following method
>
>Private rtfRichTxtBox As RichTextBox
>
>Set rtfRichTxtBox=Form.Controls.Add("VB.RichTextBox","rtfRichTxtBox")
>
>It gives me an error looking for a object I don't rember the
>name of the object. So, how should I proceed in this case.
This one was a bit harder! Place this code on the form and uncheck the option named «Remove information about unused ActiveX control» in the Make tab of the project properties.
Option Explicit
Private rtfRichTxtBox As RichTextLib.RichTextBox
Private Sub Command1_Click()
Set rtfRichTxtBox = Controls.Add("RICHTEXT.RichtextCtrl.1", "rtfRichTxtBox")
With rtfRichTxtBox
.Visible = True
.Width = 2000
.Text = "Hello"
.Top = 1000
.Left = 1000
End With
End Sub
>And one more thing is there any command like @ R,C Say "Hello" as
>we have in FoxPro which is very useful in printing.i.e. How should
>I print at the particular position a String/Value using Report
>Writer in VB 6.0
Which report writer? Are you talking about the Data Report? If so, I really don't think that you can use this syntax (@r,c) which comes directly from the dBase, Clipper and FoxPro world!
I would like to say that it is a lot easier (and also more inviting) for us to read 3 small unrelated question than 1 big.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com