VBA to insert data from Excel to an Access Database limited to 255 characters

cmschlatt

New Member
Joined
Jun 3, 2015
Messages
10
Hi all,

I have some code that inserts lines of data that a user enters into Excel into an Access database. For some reason I am unable to upload more than 255 characters in a cell to Access. I have the Access column set to "Memo" and if I manually paste data >255 characters directly into the database it works fine. Any ideas why I can't have more than 255 from Excel? Here is the code. Thank you.

Code:
Public Sub DoTrans()


Set cn = CreateObject("ADODB.Connection")
dbPath = "H:\Market\REPO\Repo_Main.accdb"
dbWb = Application.ActiveWorkbook.FullName
'dbWs = Application.ActiveSheet.Name
scn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & dbPath
dsh = "[" & Application.ActiveSheet.Name & "$]"
cn.Open scn
ssql = "INSERT INTO REPO_IT ([Review Date], [Action Date], [Market], [Market Grouping], [Action Theme], [Test Active], [APs Impacted], [Notes]) "
ssql = ssql & "SELECT * FROM [Excel 12.0;HDR=YES;DATABASE=" & dbWb & "]." & dsh


cn.Execute ssql


If Err = 0 Then MsgBox Application.UserName & " has been REPO'd!!!", vbInformation


End Sub
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,223,723
Messages
6,174,117
Members
452,545
Latest member
boybenqn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top