User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 402,808 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,069 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 279 | Replies: 1
Reply
Join Date: Jul 2008
Posts: 1
Reputation: lIGhT4umEnAll is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
lIGhT4umEnAll lIGhT4umEnAll is offline Offline
Newbie Poster

Help! to create a table in Oracle with dynamically assigned name from VB 6.0.

  #1  
Jul 17th, 2008
Hi friends
I need some help from VB and Oracle guru's.
I am trying to create a dynamic table from VB 6.0 in Oracle (mean I want to create a table whose name is dynamic issue)
For this purpose I code as follow and get error table name is not valid:-

1. Draw a Text Box on form with name tblNametxt
2. Draw a button on form with name cratblebtn
3. Variable Declaration
               Dim Cn as ADODB.Connection
               Dim Conn as String
               Dim vtblNametxt as String
4. Established a successful connection between VB 6.0 and Oracle 8i.
5. Code for button
	vtblNametxt= tblNametxt.txt
Cn.Execute(“create table ‘ ” + vtblNametxt + ” ’ (id varchar2(3), pname varchar2(20), qtyp number(4))”)
on click at button in running mode I got an error :Table name is invalid

I repeat point 5 as
vtblNametxt= tblNametxt.txt
Cn.Execute(“create table ”  & vtblNametxt & ” (id varchar2(3), pname varchar2(20), qtyp number(4))”)
But again I got an error :Table name is invalid

I again repeat as fixed name as
vtblNametxt= tblNametxt.txt
Cn.Execute(“create table sman(id varchar2(3), pname varchar2(20), qtyp number(4))”)
Then this code is run successfully.

Kindly help to create a table with dynamically assigned name from VB 6.0.

Thanks in advance
Last edited by Tekmaven : Jul 17th, 2008 at 12:33 pm. Reason: Code tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2007
Posts: 78
Reputation: manoshailu is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 6
manoshailu's Avatar
manoshailu manoshailu is offline Offline
Junior Poster in Training

Re: Help! to create a table in Oracle with dynamically assigned name from VB 6.0.

  #2  
Jul 18th, 2008
hi,


Store the whole query in string variable and execute.

SQL = ("create table "  & vtblNametxt & " (id varchar2(3), pname varchar2(20), qtyp number(4))")
cn.Execute(SQL)


Shailaja
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 10:58 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC