LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default how-to use Excel to upload records to a MySQL database?

Thanks Jim and Jamie. This is what I was looking for. I think I like the
method of writing my own SQL statements the best. I just wasn't sure how to
pass them through.

I appreciate the input.

chris

"Jamie Collins" wrote:

"Jim Thomlinson" wrote ...

Here is how I send a record to an Access Database. <<snipped


If that's one approach then here's another, using SQL DML:

Option Explicit

'Declare Module Level Constants
Private Const m_cDBLocation As String = "\\C:\Forecast.mdb"
Private Const m_cLogFile As String = "tblLogFile"

Public Sub LogIn()
Dim cnt As Object
Set cnt = CreateObject("ADODB.Connection")

' Open connection to the database
With cnt
.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & m_cDBLocation
.Open
.Execute _
"INSERT INTO " & m_cLogFile & _
" ([User Name], [In As], Logged, [Time])" & _
" VALUES ('Me', 'Myself', 'In', NOW);"
.Close
End With
End Sub

Jamie.

--

 
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
How can I import data from a mysql database into excel Tina Excel Discussion (Misc queries) 3 May 18th 06 04:21 AM
Using Excel for MySQL database import inspireme Excel Discussion (Misc queries) 1 January 6th 06 10:59 PM
Database records from excel templates BeeJay Excel Discussion (Misc queries) 4 June 22nd 05 03:02 PM
Upload Excel data into online database DH[_3_] Excel Programming 1 September 30th 03 12:57 AM
Adding New Records To Excel Database.. steve Excel Programming 0 August 18th 03 09:11 PM


All times are GMT +1. The time now is 05:26 PM.

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"