Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / March 2008



Tip: Looking for answers? Try searching our database.

novice in ADO

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ytayta555 - 20 Mar 2008 20:41 GMT
I'm the first time here , I say you a  good day

Can somebody please to learn me if ADO
can do an autofill method in a closed workbook ? ...
... to do in a closed workbook the same action
like in VBA  :
Range("B91:B7000").Select
   Selection.AutoFill Destination:=Range("B91:BB7000"),
Type:=xlFillDefault

???This is my first information that I need strongly !

2.The second thing is to know if ADO can do ClearContents in a closed
workbook like in VBA  code :
Sheets("1").Range("C91:BB22005").ClearContents,
but with the workbook not open .

Thank you very much ,any sugestion is very
helpfull for me .
Ralph - 21 Mar 2008 00:00 GMT
> I'm the first time here , I say you a  good day
>
[quoted text clipped - 15 lines]
> Thank you very much ,any sugestion is very
> helpfull for me .

You're perhaps confusing technologies. ADO, "ActiveX Data Objects", is a
data access library for connecting to a datasource. There is nothing
built-in to do what you want, but you could presumably write code using ADO
if you treated the Excel worksheet as a separate 'database' and then looped
through the data making the changes.

Perhaps what you really want is 'Automation'?

What programming platform are you using? Classic VB (VB6 or lower) or
something else? Or Office VBA?
Does the user always have to have Excel present?

Perhaps if you gave us more details about what you are trying to do.

-ralph
ytayta555 - 21 Mar 2008 02:37 GMT
> Perhaps if you gave us more details about what you are trying to do.

Thank you very much , Ralph

Actually I have a database of  231 workbooks in excel
only ,  and  I have  a macro which is
doing the querry for extract my
informations that  I need from this 231 workbook
database .The macro is write in VBA code ;

Now , I found and I learnt to work with
ADO for extract data from closed workbooks , and
the speed of get results is very fast ;here is( for
example) the macro which extract data from closed workbooks  :

Sub GetData_Example1()
' It will copy the Header row also (the last two arguments are True)
' Change the last argument to False if you not want to copy the header
row
   GetData ThisWorkbook.Path & "\WAVE\YTA1.xls", "1", _
           "B91:B636", Sheets("1").Range("B5"), True, False
End Sub

If ADO could be done and 2 more things ,posted
before , it will be extraordinary ; I look for SPEED !!!
The speed for me mean a bigger database , what I
want and looking  for ! .....

I have need a method to autofill range :
Range("B91:B65536").Select
   Selection.AutoFill Destination:=Range("B91:BB65536"),
Type:=xlFillDefault
(so look in VBA code)

and the second thing , to ClearContents range :
Sheets("1").Range("C91:BB65536").ClearContents
(so look in VBA code);

My problem is to know if ADO can do this things ,
and if it work faster then my actually  VBA code  !

Thank you very much again !
Respectfully
Ralph - 21 Mar 2008 04:18 GMT
> > Perhaps if you gave us more details about what you are trying to do.
>
[quoted text clipped - 39 lines]
> Thank you very much again !
> Respectfully

If you can compose a query that returns the records that are equivalent to
"Range( ...)" then you could simply loop through the records setting the
*Field* of interest to the new value (either some default, incremented
value, etc, or null, empty, etc.) then update the database, in this case,
Excel.

I don't know if that would be any faster or not.

-ralph
ytayta555 - 21 Mar 2008 12:19 GMT
Many thanks , Ralph

I'm beginner in ADO , I don't know to
write querry in ADO to corespund to this 2
actions in VBA   : Range("B91:B65536").Select
   Selection.AutoFill Destination:=Range("B91:BB65536"),
Type:=xlFillDefault , and Sheets("1").Range("C91:BB65536").
ClearContents  ;
This are only 2 things I need (and I don't know if
ADO do this actions with workbook not open ).
Ralph - 21 Mar 2008 15:21 GMT
> Many thanks , Ralph
>
[quoted text clipped - 6 lines]
> This are only 2 things I need (and I don't know if
> ADO do this actions with workbook not open ).

This should get you started...

"How To Use ADO with Excel Data from Visual Basic or VBA"
http://support.microsoft.com/kb/257819

-ralph
ytayta555 - 21 Mar 2008 15:47 GMT
maybe can combin ADO with SQL to
do autofill and clearcontents in a closed
workbook ?

Many thanks for sugestions , Ralph
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.