Click here to Skip to main content
15,910,009 members
Home / Discussions / Database
   

Database

 
QuestionProblem with Attach In 2005 Pin
mehrdadc481-Oct-07 8:14
mehrdadc481-Oct-07 8:14 
AnswerRe: Problem with Attach In 2005 Pin
Marek Grzenkowicz2-Oct-07 1:22
Marek Grzenkowicz2-Oct-07 1:22 
QuestionHelp with FormView please Pin
sjp7001-Oct-07 8:13
sjp7001-Oct-07 8:13 
AnswerRe: Help with FormView please Pin
Pete O'Hanlon1-Oct-07 10:17
mvePete O'Hanlon1-Oct-07 10:17 
QuestionIdentity after updated Pin
webhay1-Oct-07 7:17
webhay1-Oct-07 7:17 
AnswerRe: Identity after updated Pin
pmarfleet1-Oct-07 9:50
pmarfleet1-Oct-07 9:50 
AnswerRe: Identity after updated Pin
Pete O'Hanlon1-Oct-07 10:41
mvePete O'Hanlon1-Oct-07 10:41 
QuestionCurrentDb Connection String... Pin
new_phoenix1-Oct-07 7:04
new_phoenix1-Oct-07 7:04 
I would appreciate some info regarding how to connect to the currently open database using the CurrentDb connection string. I am not certain of the syntax. Here is what I have so far:

Dim dbsHeadcount As Database
Dim Cnxn As ADODB.Connection
Dim strConn As String
Dim rstInputFile As ADODB.Recordset
Dim cmdSQLInputFile As ADODB.Command
Dim strSQLInputFile As String
Dim rstHyperionMany As ADODB.Recordset
Dim cmdSQLHyperionMany As ADODB.Command
Dim strSQLHyperionMany As String
Dim rstHyperionOne As ADODB.Recordset
Dim cmdSQLHyperionOne As ADODB.Command
Dim strSQLHyperionOne As String
Dim strDBPath As String
Dim strFileName As String
Dim strMessage As String

Set dbsHeadcount = CurrentDb
Set cmdSQLInputFile = New ADODB.Command
Set cmdSQLInputFile.ActiveConnection = CurrentDb.Connection   '  IS THIS RIGHT??? IF NOT WHAT IS THE SYNTAX??? :confused::confused::confused:
strSQLInputFile = "SELECT [COUNTRY], [TYPE], [BUSINESS UNIT], " & _
    "[L/R/G], [REGION], [JOB FUNCTION], [09/12/2007 Reported] " & _
    "[NUMINDEX] FROM [TBLINPUTFILE]"
cmdSQLInputFile.CommandType = adCmdText
cmdSQLInputFile.CommandText = strSQLInputFile
Set rstInputFile = cmdSQLInputFile.Execute()
rstInputFile.MoveFirst

Set cmdSQLHyperionMany = New ADODB.Command
Set cmdSQLHyperionMany.ActiveConnection = CurrentDb.Connection
strSQLHyperionMany = "SELECT [COUNTRY], [TYPE], [BUSINESS UNIT], " & _
    "[L/R/G], [REGION], [JOB FUNCTION], [09/12/2007 Reported] " & _
    "FROM [tblInputFile]"
cmdSQLHyperionMany.CommandType = adCmdText
cmdSQLHyperionMany.CommandText = strSQLHyperionMany
Set rstHyperionMany = cmdSQLHyperionMany.Execute()
rstHyperionMany.MoveFirst


The problem is how do I connect to the CurrentDb.Connection that is currently active?
AnswerRe: CurrentDb Connection String... Pin
Dave Kreskowiak1-Oct-07 7:13
mveDave Kreskowiak1-Oct-07 7:13 
GeneralRe: CurrentDb Connection String... Pin
new_phoenix1-Oct-07 7:23
new_phoenix1-Oct-07 7:23 
QuestionFTP Solution to find.... Pin
soniasan30-Sep-07 21:30
soniasan30-Sep-07 21:30 
AnswerRe: FTP Solution to find.... Pin
Dave Kreskowiak1-Oct-07 7:10
mveDave Kreskowiak1-Oct-07 7:10 
AnswerRe: FTP Solution to find.... Pin
andyharman1-Oct-07 7:27
professionalandyharman1-Oct-07 7:27 
QuestionAuto generated primary key Pin
anuradha.rrao30-Sep-07 3:33
anuradha.rrao30-Sep-07 3:33 
AnswerRe: Auto generated primary key Pin
Paul Conrad30-Sep-07 11:44
professionalPaul Conrad30-Sep-07 11:44 
AnswerRe: Auto generated primary key Pin
Suaysh Andhare30-Sep-07 22:47
Suaysh Andhare30-Sep-07 22:47 
AnswerRe: Auto generated primary key Pin
Vimalsoft(Pty) Ltd1-Oct-07 22:07
professionalVimalsoft(Pty) Ltd1-Oct-07 22:07 
GeneralRe: Auto generated primary key Pin
anuradha.rrao3-Oct-07 9:15
anuradha.rrao3-Oct-07 9:15 
QuestionADO.NET Pin
sean0029-Sep-07 18:54
sean0029-Sep-07 18:54 
AnswerRe: ADO.NET Pin
Gamzun29-Sep-07 22:20
Gamzun29-Sep-07 22:20 
GeneralRe: ADO.NET Pin
sean0030-Sep-07 15:22
sean0030-Sep-07 15:22 
AnswerRe: ADO.NET Pin
John-ph29-Sep-07 23:28
John-ph29-Sep-07 23:28 
AnswerRe: ADO.NET Pin
Suaysh Andhare30-Sep-07 22:55
Suaysh Andhare30-Sep-07 22:55 
Questioni need help Pin
nowdy29-Sep-07 12:31
nowdy29-Sep-07 12:31 
AnswerRe: i need help Pin
Paul Conrad29-Sep-07 13:07
professionalPaul Conrad29-Sep-07 13:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.