It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

How to insert a CLOB data into an Oracle10g table using VB6

Moderator: dafunkymunky

How to insert a CLOB data into an Oracle10g table using VB6

Postby lavanya on Fri Aug 22, 2008 9:32 am

Hi,
I am working on a MS access to Oracle Migration project for a VB application. The memo datatype in MSAccess has been migrated to CLOB data type in Oracle. But, I have problem in inserting data to the CLOB field through VB Code.
Example: I am using the following code to insert, where CommentsUW is of CLOB data type. Please help.

gstrDbName = "dbname"
gstrConnectionString = "PROVIDER=OraOLEDB.Oracle.1;USER ID=userid;PASSWORD=pwd;DATA SOURCE=" & gstrDbName & ";"

Set PhysiciansDbConnection = New ADODB.Connection
PhysiciansDbConnection.Mode = adModeReadWrite
PhysiciansDbConnection.Open gstrConnectionString
Dim AddedRecord As Boolean

AddedRecord = False
If ValidateUnderwriterData Then
Dim PhysiciansRecordset As ADODB.Recordset

Set PhysiciansRecordset = New ADODB.Recordset
With PhysiciansRecordset
.Open gstrSQL, PhysiciansDbConnection, adOpenDynamic, adLockOptimistic, 1

If (.BOF And .EOF) Then
If MsgBox("Do you want to Save Underwriter Information?", vbQuestion + vbYesNoCancel, "Save Warning") = vbYes Then
.AddNew
.Fields("UnderwriterID") = txtUnderWriterId.Text
.Fields("UnderwriterNumber") = txtUnderWriterId.Text
.Fields("FirstNameUW") = Trim(txtFirstName.Text)
.Fields("CommentsUW") = Trim(txtComment.Text)
.Fields("UserName") = Trim(txtUserName.Text)
.Fields("Password") = Trim(txtPassword.Text)
.Update
AddedRecord = True

If AddedRecord = True Then
.MovePrevious
AddedRecord = False
lavanya
 
Posts: 0
Joined: Fri Aug 22, 2008 9:09 am

Who is online

Users browsing this forum: No registered users and 6 guests