Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> i have a problen

i have a problen

From: chris ong via DBMonster.com <forum_at_nospam.DBMonster.com>
Date: Tue, 17 May 2005 03:12:37 GMT
Message-ID: <20f5e592da36440d9bc7ce52fffa534e@DBMonster.com>


hi everyone...

i have a bunch of codes here where i browse the computer for a txt file then collect the information and store it into a database.. but i had this error "invalid table name " and "invalid column name" when i run the codes... the codes are as below

    Private Sub submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles submit.Click

        Dim something As String = something
        Dim oSQLConn As OleDbConnection = New OleDbConnection
        Dim strconn As String = "Provider=""OraOLEDB.Oracle"";User
ID=esurvey;Password=esurvey;Data Source=esurvey;Extended Propertie" & _
        "s=;Persist Security Info=False"
        Dim myConn As New OleDbConnection(strconn)
        myConn.Open()

        Dim sql1 As String
        ' Create an instance of StreamReader to read from a file.
        Dim sr As StreamReader = New StreamReader(myFile.Value)
       
        Dim line As String
        Dim str As String
        Dim i As Integer = 1
        Dim x As Integer = 1
        Dim length As Integer = 1
        Dim fieldColumn() As String

        Do
            line = sr.ReadLine

            If Not line Is Nothing Then

                Dim splitout As Object = Split(line, vbTab)
                fieldColumn = Split(line, vbTab)

                Dim tbRndStr As String = RndStr(4)
                Dim tRndStr As String

                If i = 1 Then

                    sql1 = "CREATE TABLE " + tbRndStr + "("
                    For Each str In splitout
                        sql1 &= "" & str & " varchar(100) NULL"
                        If x < fieldColumn.Length Then
                            sql1 = sql1 & ", "
                            x = x + 1
                            System.Diagnostics.Trace.WriteLie   

(fieldColumn.Length)
End If Next str sql1 &= ")" Dim SqlCommand1 As OleDbCommand = New OleDbCommand
(sql1, myConn)
System.Diagnostics.Trace.WriteLine(sql1) SqlCommand1.ExecuteNonQuery() <--- Error Session(tRndStr) = tbRndStr

thanks for any help

-- 
Message posted via http://www.dbmonster.com
Received on Mon May 16 2005 - 22:12:37 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US