PC Review


Reply
Thread Tools Rate Thread

How to connect to database through Macro Excel in MAC

 
 
New Member
Join Date: Apr 2011
Posts: 1
 
      22nd Apr 2011
Hi All,

Im a beginner in Macro Excel. I have been trying to connect database through Macros. But I am getting the "Run Time Error:429" ActiveX Componenet can't create object


Below is the mentioned code that i have been working on.

/***** Start of code******?
Sub AnalyzeDBA1Tables()
Dim str As String
Dim strSQL As String

Set cnn = CreateObject(“ADODB.Connection”)

cnn.Open ("User ID=scott" & ";Password=tiger" & ";Data Source=**.**.**.**" & ";Provider=*")

Set rs = CreateObject(“ADODB.Recordset”)

row = 5

col = 5

numRs = rs.Fields.Count

num = 0

strSQL = "select * from employee"

rs.Open strSQL, cnn

Do Until rs.EOF

Do While num < numRs

Cells(row, col + num).Value = rs(num)

num = num + 1

Loop

num = 0

row = row + 1

rs.moveNext

Loop

rs.Close

cnn.Close

End Sub

/*****End of code********/

I know after a lot of googling that Activex Object library is not present in MAC Excel 2011. Can you please tell any alternative solutions to connect the database

Please guide me through how to establish the connection.

Your valuable help is required urgently.

Thanx in advance,
Jibanendu
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant connect to Access database from excel using vba jdg Microsoft Excel Programming 4 23rd Jul 2008 05:10 PM
HELP: Need macro for excel to get data from server database and use results to populate an Access Database Clinton M James Microsoft Access 1 7th Oct 2007 04:32 PM
Using Excel as a database and need macro or vba to take data entered on one tab and update the database by adding to the next avail row rjr Microsoft Excel Programming 5 11th Jun 2006 09:43 PM
connect a form to excel database =?Utf-8?B?S2F0aHk=?= Microsoft Excel Misc 5 10th Oct 2005 06:17 AM
Word macro to connect to Oracle database =?Utf-8?B?cmljYWZvcnJpY2E=?= Microsoft Word Document Management 1 22nd Jun 2005 05:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:57 AM.