Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Excel connection to ODBC database

Hi

I have excel 2007 .xlsx file. It contains exactly same rows as my database.

How can i create an automated connection, that updates the data to a
database via ODBC?

For example:

I update a row in excel file - The updated value goes automatically into
the database.

Thanks for your help!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Excel connection to ODBC database

http://www.datamystic.com/datapipe/excel_odbc.html

If this post helps click Yes
---------------
Jacob Skaria


"Poppe" wrote:

Hi

I have excel 2007 .xlsx file. It contains exactly same rows as my database.

How can i create an automated connection, that updates the data to a
database via ODBC?

For example:

I update a row in excel file - The updated value goes automatically into
the database.

Thanks for your help!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Excel connection to ODBC database

Hi

Your answer creates an ODBC connection into the excel file.

I do not want this.

I have already the ODBC connection created under administrative tools to my
database that is located in a server (sybase sql).

I need to create connection from the excel file into this database via ODBC,
so that the updates to excel file go automaticallly into the database table.

BR,
Poppe


"Jacob Skaria" wrote:

http://www.datamystic.com/datapipe/excel_odbc.html

If this post helps click Yes
---------------
Jacob Skaria


"Poppe" wrote:

Hi

I have excel 2007 .xlsx file. It contains exactly same rows as my database.

How can i create an automated connection, that updates the data to a
database via ODBC?

For example:

I update a row in excel file - The updated value goes automatically into
the database.

Thanks for your help!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,819
Default Excel connection to ODBC database

That would be database connection TO Excel, not from.

Poppe wrote:

Hi

Your answer creates an ODBC connection into the excel file.

I do not want this.

I have already the ODBC connection created under administrative tools to my
database that is located in a server (sybase sql).

I need to create connection from the excel file into this database via ODBC,
so that the updates to excel file go automaticallly into the database table.

BR,
Poppe


"Jacob Skaria" wrote:


http://www.datamystic.com/datapipe/excel_odbc.html

If this post helps click Yes
---------------
Jacob Skaria


"Poppe" wrote:


Hi

I have excel 2007 .xlsx file. It contains exactly same rows as my database.

How can i create an automated connection, that updates the data to a
database via ODBC?

For example:

I update a row in excel file - The updated value goes automatically into
the database.

Thanks for your help!


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Excel connection to ODBC database


Hi

The data needs to move from an excel chart to the database.

Can anybody help ? For example with VB script ?

Thanks!

"Bob I" wrote:

That would be database connection TO Excel, not from.




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,819
Default Excel connection to ODBC database

Excel doesn't SEND data. Consider asking the folks in the group for your
database, as you want "pull" the Excel information, working from the
database end.

Poppe wrote:

Hi

The data needs to move from an excel chart to the database.

Can anybody help ? For example with VB script ?

Thanks!

"Bob I" wrote:


That would be database connection TO Excel, not from.




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Excel connection to ODBC database

Hi

I'm going to write a visual basic code, that enables the sending action back
to the database with activeX (ADO). It seems to be the best choice in this
situation.

Basically it reads the cels and sends them back to the tables in the database.

If somebody else has already done this, i'd appreciate code example.

Thanks!


"Bob I" wrote:

Excel doesn't SEND data. Consider asking the folks in the group for your
database, as you want "pull" the Excel information, working from the
database end.

Poppe wrote:

Hi

The data needs to move from an excel chart to the database.

Can anybody help ? For example with VB script ?

Thanks!

"Bob I" wrote:


That would be database connection TO Excel, not from.





  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 108
Default Excel connection to ODBC database

Hi Poppe,

Here is a way to do it using DAO. You need to set a reference to 'Microsoft
DAO 3.6 Object Library' in the VBE Tools - References menu before running
this code.

AFAIK this works on all versions of Excel from 95 on.
Hopefully this will get you started.

Ed Ferrero
www.edferrero.com

==============================================

Option Explicit

' change a database record using DAO

Sub CopyChangedRecords()

'Dim DataSource As Variant
Dim name_of_database As String
Dim WS1 As Workspace
Dim Db1 As Database
Dim Rs1 As Recordset
Dim findstring As String

' this sample makes a change to an Access database table
' database: SciFi.mdb
' Table: Publisher
' Fields: Publisher text - primary key
' Country text

name_of_database = "D:\Documents\Developent\Ed\EIS\SciFi.mdb"


' use DAO to write to the database
With DBEngine
Set WS1 = .CreateWorkspace(Name:="Work_S1", _
UserName:="Admin", _
Password:="")
.Workspaces.Append WS1
End With
Set Db1 = WS1.OpenDatabase(Name:=name_of_database, ReadOnly:=False)
Set Rs1 = Db1.OpenRecordset(Name:="Publisher", Type:=dbOpenDynaset)

' update records
' find record by searching primary key

findstring = "[Publisher]='Avon'"
With Rs1
.FindFirst findstring
.Edit
.Fields("Country").Value = "UK"
.Update
End With

' clean up
Db1.Close
Set Rs1 = Nothing
Set Db1 = Nothing
Set WS1 = Nothing

End Sub

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Excel connection to ODBC database


Hi

What is the difference between ADO and DAO?

I was able to write a code with ADO, the excel chart now is able to send
data to database, so my problem is pretty much solved. It uses ODBC
connection.

BR,
Poppe


"Ed Ferrero" wrote:

Hi Poppe,

Here is a way to do it using DAO. You need to set a reference to 'Microsoft
DAO 3.6 Object Library' in the VBE Tools - References menu before running
this code.

AFAIK this works on all versions of Excel from 95 on.
Hopefully this will get you started.

Ed Ferrero
www.edferrero.com

==============================================

Option Explicit

' change a database record using DAO

Sub CopyChangedRecords()

'Dim DataSource As Variant
Dim name_of_database As String
Dim WS1 As Workspace
Dim Db1 As Database
Dim Rs1 As Recordset
Dim findstring As String

' this sample makes a change to an Access database table
' database: SciFi.mdb
' Table: Publisher
' Fields: Publisher text - primary key
' Country text

name_of_database = "D:\Documents\Developent\Ed\EIS\SciFi.mdb"


' use DAO to write to the database
With DBEngine
Set WS1 = .CreateWorkspace(Name:="Work_S1", _
UserName:="Admin", _
Password:="")
.Workspaces.Append WS1
End With
Set Db1 = WS1.OpenDatabase(Name:=name_of_database, ReadOnly:=False)
Set Rs1 = Db1.OpenRecordset(Name:="Publisher", Type:=dbOpenDynaset)

' update records
' find record by searching primary key

findstring = "[Publisher]='Avon'"
With Rs1
.FindFirst findstring
.Edit
.Fields("Country").Value = "UK"
.Update
End With

' clean up
Db1.Close
Set Rs1 = Nothing
Set Db1 = Nothing
Set WS1 = Nothing

End Sub


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
link ODBC connection to an Oracle database Richard Excel Discussion (Misc queries) 1 November 5th 06 04:29 PM
ODBC connection failed. Jim Moberg Excel Discussion (Misc queries) 0 October 9th 06 03:51 PM
ODBC connection failed. Jim Moberg Excel Discussion (Misc queries) 0 October 9th 06 03:48 PM
Broken ODBC Connection dsb Links and Linking in Excel 1 June 12th 06 11:47 PM
How do I set up my ODBC Connection from AS/400 file in Excel 2003 HTIMAPICSAdmin Excel Discussion (Misc queries) 0 June 1st 05 08:13 PM


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