|
-
Jan 18th, 2006, 05:01 AM
#1
Thread Starter
Addicted Member
Runtime Creation of Databases......problem
Hi All,
Friends am developing a System as VB GUI while MS Access as Databases
I wants to Take Fields From Two Tables Inwards & Inwards_item.
Report i Have Designed in Crystal Report Named as Print_invoice
I have Extracted Fields Using SQL Query.
My Logic Is Like This
Oening Database Connection
Fetchiing Record Using Query
Creating Temporary Table & Putting the Record I Want.
Report Will Run From Temp Table
How Do i Do this
This is My Code[Highlight=VB]
Dim SQL As String
Dim rs As New ADODB.Recordset
Dim cn As New ADODB.Connection
Dim connectionstring As String
connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Program Files\Microsoft Visual Studio\Prepaid Management System\Login.mdb"
cn.Open connectionstring
Set rs = New ADODB.Recordset
Set rs.ActiveConnection = cn
rs.Open " select * into Inward_dd from Inwards_item Where Receipt_no = 1"
'CrystalReport1.DataSource = rs
CrystalReport1.SQLQuery = "select * into Inward_dd from Inwards_item Where Receipt_no = 1"
CrystalReport1.Action = 1
MsgBox ("Table Created Successfully"), vbInformation
Debug.Print Err
SQL = "DROP TABLE Inward_dd;"
cn.Execute SQL
MsgBox ("Table Dropped Successfully"), vbInformation
Set rs = Nothing
Set cn = Nothing
Any Help i sHighly Appericiated
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
|