Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Basic ADO medthod - working with recordset, plz help.


Hi all,

I'm using ADO as a begginner.
I'm confused with recordset melthod: seek, edit, addnew, sort ...

Thanks


--
OverAC
------------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Basic ADO medthod - working with recordset, plz help.

Do a Google. I found this http://www.w3schools.com/ado/ado_recordset.asp

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"OverAC" wrote in
message ...

Hi all,

I'm using ADO as a begginner.
I'm confused with recordset melthod: seek, edit, addnew, sort ...

Thanks


--
OverAC
------------------------------------------------------------------------
OverAC's Profile:

http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Basic ADO medthod - working with recordset, plz help.


Dear Bob Phillips

Thanks for your link, it's very helpful and It helped me to understand
more about ADO. It will be great if those code is for Excel VBA (they
all now are for html :( ).

Thanks anyway.

OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Basic ADO medthod - working with recordset, plz help.

Recordsets work in the same way in Excel. You are after all just accessing
via ADO, which simplifies matters. Here is a simple example of reading an
Excel sheet into a recordset

Public Sub GetData()
Dim oConn As ADODB.Connection 'Object
Dim oRS As ADODB.Recordset 'Object
Dim sFilename As String
Dim sConnect As String
Dim sSQL As String

sFilename = "c:\Mytest\Volker1.xls"
sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & sFilename & ";" & _
"Extended Properties=Excel 8.0;"

sSQL = "SELECT * FROM [Sheet1$]"

Set oRS = New ADODB.Recordset 'CreateObject("ADODB.Recordset")
oRS.Open sSQL, sConnect, adOpenForwardOnly, _
adLockReadOnly, adCmdText

If Not oRS.EOF Then
ActiveSheet.Range("A1").CopyFromRecordset oRS
Else
MsgBox "No records returned.", vbCritical
End If

oRS.Close
Set oRS = Nothing

End Sub



--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"OverAC" wrote in
message ...

Dear Bob Phillips

Thanks for your link, it's very helpful and It helped me to understand
more about ADO. It will be great if those code is for Excel VBA (they
all now are for html :( ).

Thanks anyway.

OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile:

http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Basic ADO medthod - working with recordset, plz help.


Thanks. That's great.

a little confusing thing remains, please help me the code to list ou
all records which have a field match my conditions. for ex
CustomerName begins with ABC
(I understand how to start with ADO now, so ignore cornection)
Thanks in advance

OverA

--
OverA
-----------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...fo&userid=3239
View this thread: http://www.excelforum.com/showthread.php?threadid=52163



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Basic ADO medthod - working with recordset, plz help.

Do you want to do it in the recordset, in VBA, or in another Excel
spreadsheet?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"OverAC" wrote in
message ...

Thanks. That's great.

a little confusing thing remains, please help me the code to list out
all records which have a field match my conditions. for ex:
CustomerName begins with ABC
(I understand how to start with ADO now, so ignore cornection)
Thanks in advance

OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile:

http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Basic ADO medthod - working with recordset, plz help.

.... or even in the initial query?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"OverAC" wrote in
message ...

Thanks. That's great.

a little confusing thing remains, please help me the code to list out
all records which have a field match my conditions. for ex:
CustomerName begins with ABC
(I understand how to start with ADO now, so ignore cornection)
Thanks in advance

OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile:

http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Basic ADO medthod - working with recordset, plz help.


I'm trying to access to a excel database without open it so I used ADO
in VBA from another excel file. That's why I want to know about ADO,
recordset..
I've just discovered a little about SQL but I think your explaination
will make clearer.
Thanks.
OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Basic ADO medthod - working with recordset, plz help.

Use the WHERE clause in the SQL.

For instance, assuming you have a column with a header of Name, you can use

sSQL = "SELECT * FROM [Sheet1$] WHERE Name = 'OverAC'"


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"OverAC" wrote in
message ...

I'm trying to access to a excel database without open it so I used ADO
in VBA from another excel file. That's why I want to know about ADO,
recordset..
I've just discovered a little about SQL but I think your explaination
will make clearer.
Thanks.
OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile:

http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Basic ADO medthod - working with recordset, plz help.


Understood, That's great.
Maybe these are some thing I will ask, but it's great till now.

a little curious and personal, I wonder what "HTH" means (in your
post)

Thanks very much.

OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Basic ADO medthod - working with recordset, plz help.

It means

Hop That Helps

See
http://www.acronymfinder.com/af-quer...=HTH&Find=Find

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"OverAC" wrote in
message ...

Understood, That's great.
Maybe these are some thing I will ask, but it's great till now.

a little curious and personal, I wonder what "HTH" means (in your
post)

Thanks very much.

OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile:

http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630



  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Basic ADO medthod - working with recordset, plz help.

Correction Hope That Helps <vbg

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Bob Phillips" wrote in message
...
It means

Hop That Helps

See

http://www.acronymfinder.com/af-quer...=HTH&Find=Find

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"OverAC" wrote in
message ...

Understood, That's great.
Maybe these are some thing I will ask, but it's great till now.

a little curious and personal, I wonder what "HTH" means (in your
post)

Thanks very much.

OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile:

http://www.excelforum.com/member.php...o&userid=32396
View this thread:

http://www.excelforum.com/showthread...hreadid=521630





  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Basic ADO medthod - working with recordset, plz help.

See also
http://www.rondebruin.nl/ado.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"OverAC" wrote in message
...

I'm trying to access to a excel database without open it so I used ADO
in VBA from another excel file. That's why I want to know about ADO,
recordset..
I've just discovered a little about SQL but I think your explaination
will make clearer.
Thanks.
OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630



  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Basic ADO medthod - working with recordset, plz help.


Bob Phillips Wrote:
It means

Hop That Helps

See
http://www.acronymfinder.com/af-quer...=HTH&Find=Find

--
HTH

Bob Phillips

Thanks.

That link is very helpful.

OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630

  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Basic ADO medthod - working with recordset, plz help.


Ron de Bruin Wrote:
See also
http://www.rondebruin.nl/ado.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl

Thanks *Ron de Bruin* very must.
But with closed book, I not only want to get it data but also edit or
modify it.
I can't find these kind of info in your site.
Thanks

Kind Regards

OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630



  #16   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Basic ADO medthod - working with recordset, plz help.

I can't find these kind of info in your site

I am working on examples for that also

--
Regards Ron de Bruin
http://www.rondebruin.nl


"OverAC" wrote in message
...

Ron de Bruin Wrote:
See also
http://www.rondebruin.nl/ado.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl

Thanks *Ron de Bruin* very must.
But with closed book, I not only want to get it data but also edit or
modify it.
I can't find these kind of info in your site.
Thanks

Kind Regards

OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630



  #17   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Basic ADO medthod - working with recordset, plz help.


Thanks Ron de Bruin,

I'm waiting for your update.

Dears,

I have this connection
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=" & filepath & _
filename; Extended Properties=Excel 8.0"
.CursorLocation = adUseClient
.Open
End With

Everytime it runs. the file (connected file) were opened. But I really
don't want that. How can I stop opening the file.
Thanks

OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630

  #18   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Basic ADO medthod - working with recordset, plz help.


Dears,

Anybody help me. How can I stop opening the file when connecting With
ADO.
Thanks so much

OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521630

  #19   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Basic ADO medthod - working with recordset, plz help.


Dears,

I use ADO to connect to another excel file, and every time whe
connection are made, the data file open. and I don't why! Please hel
to explain this and tell me the way to prevent it. Thanks so much.

OverA

--
OverA
-----------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...fo&userid=3239
View this thread: http://www.excelforum.com/showthread.php?threadid=52163

Reply
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
Visual Basic code not working when sheet is saved joe123 Excel Discussion (Misc queries) 3 October 22nd 08 01:50 PM
Basic shortcuts not working - Have different meaning robke Excel Discussion (Misc queries) 0 January 9th 08 10:01 AM
Recordset.FindFirst argument not working... [email protected] Excel Worksheet Functions 0 March 20th 07 03:18 PM
I must be tired, because basic Math isn't working..... [email protected] Excel Worksheet Functions 0 June 22nd 06 05:30 AM
Type recordset/recordset? FlaviusFlav[_9_] Excel Programming 4 May 24th 04 12:16 PM


All times are GMT +1. The time now is 03:42 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"