I am trying to clear the contents of a table in Access from Excel, using VBA.
This code works:
Dim MoviesConn As ADODB.Connection
Set MoviesConn = New ADODB.Connection
Dim MoviesCmd As ADODB.Command
Set MoviesCmd = New...
Having an issue trying to debug someone's work, don't know this style of coding well and so not sure what is wrong here exactly but the error it says is user-defined type not defined, and I tried fixing this by defining it as a different declaration and that didn't work.
' Connect to the...
The access database is not opened. How can I change this VBA code to open the access database.
The code doesnt crash so I think the access database is opened in memory!
Dim jobconn As ADODB.Connection
Set jobconn = New ADODB.Connection
I am having trouble in the below code its keep getting me error on line
rst.Fields(Cells(1, i).Value) = Cells(x, i).Value
i dont know what the problem is please help me out.
the complete code is here
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
I am completely stuck on this one, any help will be appreciated.
I have a code which is supposed to do inserts/updates in database. I have connected to database using both (one commented out):
Dim oConn As ADODB.Connection
Set oConn = New ADODB.Connection...
I have userform and transferring some data to closed excel files. This data collecting in MS Access mdb database and I want to protect this. I found a string from the net and I connect unprotected my mdb file successful. These codes are below but I don't know how can I connect my...
I find an easy way to send data from excel sheet to access database with following VBA code :
Dim NewCon As ADODB.Connection
Set NewCon = New ADODB.Connection
Dim Recordset As ADODB.Recordset
Set Recordset = New ADODB.Recordset
HI ALL, FIRST OF ALL, SORRY ABOUT MY ENGLISH, IM NOT AMERICAN.
I HAVE AN ADODB.CONNECTION, FROM I QUERY DATA USING AN ADODB.RECORDSET, SO I ADD A QUERYTABLE TO PASTE THIS DATA ON MY SHEET USING REFRESH.
I HIGHLY WANT THAT THIS QUERYTABLE REFRESHS ALONE, SO THE DATA IS UPDATED WITHOUT THE NEED...
I am new to excel VBA. I have a requirement where I have to copy table values from sql server 2005 to an excel worksheet. I have googled and written a code for the above requirement (listed below).
In this excel sheet there are fixed set of rows which displays legends and dates. These rows...
I am trying to use ADODB connection stuff to read and copy data from a closed book.
The code will look for an excel file, read and copy the data into the sheet "PnL_T-1". Generally the macro will read the file dated as of yesterday (Date1), but sometimes I will need the macro to read...
I am running the same query from crystal reports and excel vba.
The crystal reports runs in about a second.
Excel VBA takes 26 seconds.
They both are going through the same ODBC connection.
The query comes directly from crystal reports > Database > Show SQL query
The vba code is simple...
Working in Access 2007 and Excel 2007....
I have an .accdb (WellCardPilot.accdb) that pulls information from multiple tables (some linked, some built into the DB). The following code works fine to return all records from a query called BridgeportWellCard to a specific worksheet in Excel (Sheet...