LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default SQL Insert Statement to return "13620 row(s) affected."

Thanks for all your help. Sorry for the delayed response..

Have a great day!

" wrote:

Yo Candyman,

Yeah, once you're on board with DAO you'll wonder why you ever used MS
Query ....


I am getting a "User defined type not defined" error with the line:
Public Function GetConnection(db As DBConnection) As ADODB.connection
highlighted


You have to determine if Excel can't find DBConnection or ADODB.

1. Confirm that you post the DBConnection information into a class
module.(In your project you should have MS Excel Objects,
Forms,Modules, Class Modules (and DBConnection should be a Class
Module).

2. Confirm that Excel is referencing "Microsoft DAO 3.6 Object
Library" or so 3.51 - whatever version you've got.

I am trying to run a test macro but I am not sure how to envoke the 'db' part of your function using:


Try:

Public Function GetConnectionInfo() as DBConnection
Dim db as New DBConnection
db.server = "yourserver"
db.database = "yourdatabase"
db.userName = "yourusername"
db.password = "yourPassword"
Set GetConnectionInfo = db
End Function

Sub test()
Dim str, book, WSname , myDb As String
Dim myDB as DBConnection
Dim x as Integer
myDB = GetConnectionInfo()
book = ActiveWorkbook.Name
WSname = "TEMP"
SQL = "select * from HEIDS.HE_ACAPS_LOCS"
x= SelectData(book, myDB, SQL, WSname)
End Sub



 
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
If part of a cell = "NVA" then insert "Norfolk" in return cell RNCKWMN Excel Worksheet Functions 4 June 13th 09 08:53 PM
Nested If Statement "FALSE" Return Margie Excel Worksheet Functions 8 August 17th 07 11:37 PM
Excel If statement that is supposed to return a "" instead returns a 0 omalleyman Excel Worksheet Functions 1 October 5th 06 09:18 PM
Return blank for true "if" statement when charting, not 0 Jay F Charts and Charting in Excel 1 June 21st 06 04:15 PM
Insert "-" in text "1234567890" to have a output like this"123-456-7890" Alwyn Excel Discussion (Misc queries) 3 October 25th 05 11:36 PM


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