LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Not sure this should be Excel or ACCESS

only reference required is
Microsoft ActiveX Data Objects 2.7 Library

the Connection string is in this, and mine should look like this:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Risk.mdb"
The provider tells the connection that its going to connect to an Access
database





"davyboom" wrote in message
...
Hi Patrcik,

thought your answer is to me.

I hd copy yr. module into my Excel VBA editor nand changed the poitner to
my
mdb file and its table.
Simialr error echoed.
Just wonder hw u reference yr. module.
I got "ticked" in my reference-
Microsoft ADO (multidimensional) 2.8
Microsoft ADO ext 2.8 for DDL and security
Microsoft ADO2.8 library
Microsoft Jet & application objects 2.6 library
Microsoft ADO recordset 2.8
Microsoft OLEDB provider for OLAP services connection dialog 8.0

I really do not know which give function to Jet.OLEDB.4.0

can anyonehelp me to resolve?

thanks,
davy

"Patrick Molloy" wrote:

Sub LoadDataFromAccess()
Dim MyFile As String 'DB name
Dim con As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim SQL As String
Dim i As Long 'for/next loop counter

MyFile = "Risk.mdb"
SQL = "SELECT * FROM BondTable"

con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & MyFile

rst.Open SQL, con, adOpenStatic

Cells.Clear
'add headings
For i = 0 To rst.Fields.Count - 1
Cells(1, i + 1).Value = rst.Fields(i).Name
Next

Range("A2").CopyFromRecordset rst

"davyboom" wrote in message
...
HI all,

I am learning to use SQL w. Excel.
I copied the follwowing book example into VBA(Excel) code window, I got
problem with Jet.OLEDB.4.0

Book example code:
Public Sub GetCn(ByRef dbcon As ADODB.Connection, ByRef dbrs As
ADODB.Recordset, _
sqlstr As String, dbFile As String, usernm As String, pWord As
String)

Set dbcon = New ADODB.Connection
dbcon.Open "Provider=Microsoft.jet.OLEDB.4.0; Data Source=" &
dbFile &
";", _
usernm, pWord
Set dbrs = New ADODB.Recordset
dbrs.Open sqlstr, dbcon
End Sub

Question:

MY VBA module debug got into error on this line
"Provider=Microsoft.jet.OLEDB.4.0: Data Source=".......
Error Message
[run time error '-2147467259 (80004005)' Automation error, unspecified
error]
what has been worng? how to fix?

thanks,
davy


"heavenlyhost1" wrote:

I have a report in ACCESS where the user enters a start date and end
date
of
the 'Date Submitted' field in the table. The report then gives the
total
count of records that that are generated between two given dates. I
have
an
excel report where I would like this total count to go to when the
excel
report is opened. I've tried the ODBC thing and link thing but can't
seem to
get this one field to plug into the excel spreadsheet. Can this be
done?



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trust Access to Visual Basic Project - Access to Excel and back tcb Excel Programming 0 January 8th 08 02:43 AM
How do I access the access data via Excel 2002 with auto update ? karthik Excel Programming 1 February 9th 07 01:56 PM
Importing data from Access to Excel, but I need to vary the table from Access Liz L. Excel Programming 3 June 6th 06 02:12 AM
export access to excel. change access & update excel at same time fastcar Excel Discussion (Misc queries) 0 June 24th 05 09:27 PM
Access data -work in Excel- save in Access s_u_resh Excel Programming 1 October 25th 04 12:52 PM


All times are GMT +1. The time now is 06:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"