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.
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