-
April 11th, 2013, 02:41 PM
#1
[RESOLVED] Its Urgent please solve my create table query in vb6
for my project i need to create a table. But name of table given by user in a text box
I am using Ms Access 2007 database and vb 6.0
i have written following code but getting error " Error in create table statement "
Private Sub Command1_Click()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\My Documents\project1.mdb;"
cn.Open
Dim id As String
id = text1.text
rs.Open "Create table" + id + "(id int)", cn
rs.close
I code is running if i write table name instead of variable
rs.open "Create table abc (id int)",cn
this code is working
but i need to create a table by given value
please help me
Thanks in advance
Tags for this Thread
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
|