Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
254 character/ line breaks problem with ODBC/OLE DB?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
254 character/ line breaks problem with ODBC/OLE DB?
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01233844
Message ID:
01233844
Vues:
65
Is it really true that you can not insert data into a Visual FoxPro table's memo field with either length greater than 254 characters or having line breaks from ASP.NET thru ODBC or OLE DB providern? My colleague is trowing away the FoxPro database/tables in favour for Access because of this problem. If there are no line breaks and string is shorter than 254 characters everything works Ok, but if longer or having line breaks the insert fails. He has found several articles about this problem on internet from 2004, but I just told him that this must have been solved since that.

Or can there be any problems with the code he is using?

      Dim BegDB As String
        
        'Unmodified text to the database
        BegDB = Begaran.Text  && multi-line textbox from aspx page

       'Create a data connection and insert the data into DB: ceramicsweb.dbc  - Table:  beredn_log
        '--------------------------------------------------------------------------------------------
        Dim conCeramicsWeb As OleDbConnection
        Dim strInsert As String
        Dim cmdInsert As OleDbCommand
        
        'Connection to FoxPro
        conCeramicsWeb = New OleDbConnection("Provider=VFPOLEDB.1;Data Source=D:\Intranet\CeramicsWeb\data\ceramicsweb.dbc")

        'Insert string
        strInsert = "Insert Into beredn_log (case_type, artnr, departm, requests, req_by, comp_name) Values ('ablad', '" & ArtikelNr.Text & "', '" & AvdelningsID.Text & "', '" & BegDB & "', '" & Namn.Text & "', '" & hostn & "')"
        
        'Constructor for the connection and insert string
        cmdInsert = New OleDbCommand(strInsert, conCeramicsWeb)
        
        'Open database run the query and then close the database again
        conCeramicsWeb.Open()
        cmdInsert.ExecuteScalar()  && generates error Command contains unrecognized phrase/keyword 
        conCeramicsWeb.Close()
/Torgny
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform