80040e14 Automation Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About adodb connection automation error Us Learn more about Stack Overflow the company Business Learn more about hiring run time error 2147217900 80040e14 developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the
Run-time Error -2147217900 (80040e14)
Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Automation Error upon running VBA
Vba Runtime Error 80040e4d
script in Excel up vote 3 down vote favorite 2 I'm getting an Automation error upon running VBA code in Excel 2007. I'm attempting to connect to a remote SQL Server DB and load data to from Excel to SQL Server. The error I get is, "Run-time error '-2147217843(80040e4d)': Automation error". I checked out the MSDN site and it suggested that this may be due to vba automation error a bug associated with the sqloledb provider and one way to mitigate this is to use ODBC. Well I changed the connection string to reflect ODBC provider and associated parameters and I'm still getting the same error. Here is the code with ODBC as the provider: Dim cnt As ADODB.Connection Dim rst As ADODB.Recordset Dim stSQL As String Dim wbBook As Workbook Dim wsSheet As Worksheet Dim rnStart As Range Public Sub loadData() 'This was set up using Microsoft ActiveX Data Components version 6.0. 'Create ADODB connection object, open connection and construct the connection string object. Set cnt = New ADODB.Connection cnt.ConnectionString = _ "Driver={SQL Server}; Server=onlineSQLServer2010.foo.com; Database=fooDB Uid=logonalready;Pwd='helpmeOB1';" cnt.Open On Error GoTo ErrorHandler 'Open Excel and run query to export data to SQL Server. strSQL = "SELECT * INTO SalesOrders FROM OPENDATASOURCE('Microsoft.ACE.OLEDB.12.0', & _ "'Data Source=C:\Database.xlsx; Extended Properties=Excel 12.0')...[SalesOrders$]" cnt.Execute (strSQL) 'Error handling. ErrorExit: 'Reclaim memory from the connection objects Set rst = Nothing Set cnt = Nothing Exit Sub ErrorHandler: MsgBox Err.Description, vbCritical Resume ErrorExit 'clean up and reclaim memory resources. cnt.Close If CBool(cnt.State And adStateOpen) Then Set rst = Nothing Set cnt = Nothing End If End Sub sql-server excel vba share|improve
is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 12
Adodb Connection String
of 12 Thread: [RESOLVED] 80040e14 error Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Oct 12th, 2011,07:37 AM #1 mib300 View Profile View Forum Posts Thread Starter New Member Join Date Oct 2011 Posts 5 [RESOLVED] 80040e14 error Hello guys, i am new to the VB i hv jst wirtten a scripts for inserting the data from local system to db sqlserver 2008. It was working fine but from today it start giving http://stackoverflow.com/questions/2528152/automation-error-upon-running-vba-script-in-excel the following error which i hav attached. So, i need a help on it to solve the issue. Thanks & Regards, MIB. Attached Images Reply With Quote Oct 12th, 2011,08:40 AM #2 joshAU View Profile View Forum Posts Lively Member Join Date Dec 2008 Location Hobart, Tasmania Posts 104 Re: 80040e14 error No idea off hand... but I'd have a look here: http://tutorials.aspfaq.com/8000xxxx...14-errors.html "You either used a reserved word as a column or alias name (or used a column name that begins with a number http://www.vbforums.com/showthread.php?662398-RESOLVED-80040e14-error or non-alphanumeric character), didn't delimit a value properly, or really have a syntax error. It looks like you can get the 80040E14 error for a variety of reasons... I guess 80040E14 means "it didnt work" possible causes include: a genuine syntax error attempting to insert null values into a column that doesnt allow nulls. an argument data type text is invalid for argument a permissions error an invalid object name. and more... you may need to post the script, or at least the bit that errors, to provide futher suggestions. Hope this helps. josh Reply With Quote Oct 12th, 2011,09:19 AM #3 mib300 View Profile View Forum Posts Thread Starter New Member Join Date Oct 2011 Posts 5 Re: 80040e14 error Thanx for ur prompt reply Josh. I have checked the link u have given but the issue exist please find below the script '----------------- sub processFile(path, fil) Dim f, f1, fc, sql 'print "File: " & fil & " Path: " & path & " name: " & fil.name if right(lcase(fil),4)<>".jpg" then exit sub ' a simple filter for JPGs only ' --- change references to columns path, name, add_date to suit your table sql= " select count(*) from " & MyTableName & " where path = '" & path & "' and name = '" & fil.name & "'" if getSql(sql)= 0 then ' add record sql = "insert into " & MyTableName & " (path, name, add_date) values ('" & path & "', '" & fil.name & "', getdate() )" ADO.execute(sql) end if
One games Xbox 360 games PC https://support.microsoft.com/en-us/kb/966146 games Windows games Windows phone games Entertainment All Entertainment Movies & TV Music Business & Education Business Students & educators Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security automation error Internet Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Band Microsoft 80040e14 automation error Lumia All Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft