How to create DSN Less connection on pass through query?

I have DSN Less connection code as follows for linked tables which the code
is on the switchboard form:

Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.

' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True


Dim ServerName As String
Dim UserName As String
Dim Password As String

ServerName = "CPSHOUDB15"
UserName = "********"
Password = "********"

'Attach the linked database tables if they aren't already attached
AttachDSNLessTable "dbo_MAS_MWS_AR1_CustomerMaster",
"MAS_MWS_AR1_CustomerMaster", ServerName, "MAS_TXD_IMPORT", UserName,
Password

'If CreateDSNConnection("(local)", "pubs", "", "") Then
'// All is okay.
'Else
'// Not okay.
'End If

End Sub

How would I use something like this for a Pass Through query? And where or
what form would this be placed? I have a check box on a main data entry form
that runs the pass through query. I just need help with the connection
staying connected. Any help would be appreciated. Thanks.

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/201004/1

0
osupratt
4/8/2010 2:40:35 PM
access.queries 6343 articles. 1 followers. Follow

0 Replies
2477 Views

Similar Articles

[PageSpeed] 45

Reply:

Similar Artilces:

Cross-Tab Query
I have a cross-tab query that works as desired. I can get it to post to a report. My problem is the report (legal - landscape mode) is limited to 12 items. How can I get the report to go beyond the 12 items? The data in the cross-tab query will take multiple pages to print all the data. Is there a way to get the report to pick up with the next "12" items if the cross-tab has more than 12 items? I can post a stripped-down version of the database if needed. Creating a dynamic cross-tab report is by no means easy, but it can be done. Here's Microsoft's take on it: ...

Specific Incoming Connection
We have a two Exchange 2003 servers. One of them is for OWA access only. We also have a mail relay where all the email is scanned for virus and spam. How can I specify that our Exchange server can only receive mail from the mail relay server. Thanx. "Zack" <ME@pleasedontemailme.com> wrote: >We have a two Exchange 2003 servers. One of them is for OWA access only. >We also have a mail relay where all the email is scanned for virus and spam. >How can I specify that our Exchange server can only receive mail from the >mail relay server. > >Thanx. > So the...

Linking Queries
Can anyone help? I have a system where employees register property with us. They then report back to us when they sell the property. Registered properties are held in one table and sold properties are in another, where the common field is the employee. I want to create a query where it will show the employee and the details of the registerly and the sale. I cant seem to get the details of the registry and the sale to assign to the correct employee. Thanks If you were limited to working with a spreadsheet, you might come up with a design that puts properties in one status on one s...

How to create DSN Less connection on pass through query?
I have DSN Less connection code as follows for linked tables which the code is on the switchboard form: Private Sub Form_Open(Cancel As Integer) ' Minimize the database window and initialize the form. ' Move to the switchboard page that is marked as the default. Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' " Me.FilterOn = True Dim ServerName As String Dim UserName As String Dim Password As String ServerName = "CPSHOUDB15" UserName = "********" Password = "********" 'Attach the linked database table...

Can't connect to Exchange using Outlook PC client
HI, I am suddenly having a problem connecting to my exchange server using the Outlook pc client. I keep getting a message saying "Incorrect Logon Information", even though I am sure it is correct. If I use Outlook Web Access, and the same details it is fine. I can mapp a drive also using the same credentials. Can somebody help? Regards, Imran Shah Outlook, Exchange,OE=20 Its more than just a sign on issue...its a passport validation issue = with msn.com accounts(includes both legacy pop3 spa accounts and Msn = Explorer/8 based accounts) Hotmail.com accounts appear to sti...

SQL Connection from VS 2008 Express to SQLExpress database
I'm recieving the error "Logon Failed For User". Everything looks right to me, so I am unsure what could be wrong. Here is the connection string I am using in my vb code: connectionString2 = "Server=MyComputer\SQLEXPRESS;Database=adatabasename;User ID=auserid;Password=apassword" The SQLExpress version is 2008 R2. Can you think of anything I should check besides the user account and password, which seems fine? I am able to connect to the database just fine with my windows authentication. It is a newly created database that I imported from ano...

UNION query and Data type mismatch in criteria expression
I did some searches on this problem before trying to post here to the newsgroup, but what little information I found did not seem to help. Here is the problem. I have a UNION query that joins 2 queries into 1 dataset. Each sub-query works fine individually, but when I place them into a UNION query it gives the error message "Data Type mismatch in criteria expression" I first double-checked to make sure any JOIN fields were of the same data type - which they are (everything is in TEXT format). Also, the information I found suggested there might be problems when an empty field...

List Box to create a Report based on crosstab query
I have a form with a list box to select a value, and a button that is pressed to create a report based on the value selected in the list box. The problem is the query used to create the report and populate the values in the list box is a crosstab query, which is not updateable of course. Here is the SQL for my query: TRANSFORM Avg(Val([tblCourseGrades].[Grade])) AS AvgOfGrade SELECT TblStudents.[ClassNumber], TblStudents.Rank, TblStudents.[Last Name], TblStudents.[First Name], Avg(tblCourseGrades.Grade) AS AvgOfGrade1 FROM TblStudents INNER JOIN (tblCourses INNER JOIN tblCours...

Restrictions on activities created from a sales process?
I've created sales process with sale stages and with generated activities. Is it possible to restict access to activites generated from a sales process to only be visable to the user owning the opportunity. Activities not generated from a sales process will be visable for all users. // Mats ...

Problem with creating a socket
Hi I am running Win XP SP2 Here is my socket class: class _ListenSocket : public CSocket { public: _ListenSocket(CServer* pServer); virtual ~_ListenSocket(); virtual void OnAccept(int nErrorCode); private: CServer* m_pApp; }; I created an instance of this class: _ListenSocket* m_pListenSocket; And now, I want to "create" the socket: m_pListenSocket = new _ListenSocket(this); if(!m_pListenSocket->Create(port)) { DestroyListenSocket(); AfxMessageBox(_T("Port creation failed!\n")); return false; } I did not ovewrite the Create funtion, so I am using the one f...

creating new folder in eforms registry
I am trying to create a new folder under Public Folders \ EFORMS REGISTRY called Mimosa and use the english(usa) language, but that choice is not available. Candaian, UK, Australia, etc. are available, but not USA. Any help would be appreciated. Thanks, Mike ...

update a table based on a sum query
Hi All, I have seen the zillions of answers to this that state "never add a total into the table.." But there are cases, such as mine when it is prefered. I want to update a project table with the final invoice cost. I want it entered as a hard figure so that I can then export the table for accounting purposes. Additionally, once an invoice has been generated, there isn't any need for the total to ever, ever change! In fact it shouldn't. So the question is.... is there a way to do this? To update a table with a value from a sum query? Thanks for any help. ...

How to use different type Query for Excel PivotTable? (ODBC)
How to use two different type of Database Query for Excel PivotTable? (ODBC) My PivotTable gets data from Microsoft Query by ODBC. But I can not get two different type database for ONE PivotTable. For example, one table is *.dbf, the other is *.btr, Can i use these different table for ONE PivotTable? I know Crystal Report can do it. How about Excel PivotTable? try Vb, ADO programs or SQL.Request function (Excel ODBC Add-In) with "SELECT....IN... UNION SELECT....IN... " statement. I do such a queries into another file and make PivotTs basing on it ...

tableadapter Query linked to Access 2003 table
I'm trying to write a query for my Dataset's table adapter. It is linked to an access 2003 database. Basically, I'm trying to duplicate the following query. SELECT Parts_Inventory.Aisle, Parts_Inventory.Rack, Parts_Inventory.Shelf, Parts_Inventory.QNTY, Parts_Inventory.MFG_PN, Parts_Inventory.Manufacturer, Parts_Inventory.Description FROM Parts_Inventory WHERE (((Parts_Inventory.Manufacturer) Like "*" & [?] & "*")); I'm using a text box as my control to the manufacturer field. If it is blank, it will show all my parts. I'm able...

Mutliple Complex Queries
Thank you in advance for your assistance. I have data that I must access on a weekly basis that involves a number of criteria. To date, I have performed each query and then coalesced my findings (by hand) into a table. Something tells me that this would be far easier with better knowledge of the program. I have three major data categories (Poor Performance rating, Location, and Seniority) that are dependent upon sorting the Employees into three different sections (Dismissed, Retained, and Reallocated). For each of the sections, I must calculate the percentage based upon the main data...

DSN Less Connection
I am creating a DSN less connection according to Microsofts KB. I have a question about the stServer name.... My server has dashes in the name such as \\test-dash When I replace stServer with test-dash it does not like it. I added double quotes around it, and tried leaving stServer and then write in Set stServer = test-dash but that did not work.... Any advice? I think that is the only thing keeping me from gettting this to work... or are there any better ways of doing this? '//Name : AttachDSNLessTable '//Purpose : Create a linked table to SQL Server w...

CFtpConnection::PutFile only creating 0 length file on server
hey guys, i recently made a tiny app using the MFC class CFtpConnection that is sending files to an AS/400 server. its been working consistently for a few months now with no problems. but in the last couple of weeks its been failing. during the method PutFile(), it would set the transfer type to ASCII and it would try to put the file on the server, but it only creates a 0 length file with the appropriate filename and timesout (usually after like 3 minutes or so) with a bad return code. ive googled it in groups and have found similar cases where this function was doing the same thing bu...

Connection to local MSDE Database
I have a sql query made in the jscript OnSave event of the Appointment entity, which connects (using the ADODB) to the xxx_MSCRM database on the server to fetch data and put it into fields of the appointment. Obviously, this does not work when the client is using the Offline Outlook client. My question: I would like to change to connection string to point towards the local MSDE database when the client is using outlook, but don't know which server/Instance to use, and which credential to use. I've tried finding this local msde with a ODBC connection but can't connect to it. ...

How do you create a new BLANK worksheet with same cell format as another?
Suppose I have a worksheet formatted the way I like it. In particular, it takes some effort to get column widths adjusted and various cells to display using various number formats. If I have such a sheet as an exemplar, how can I create another sheet just like that except that there is no data in it. If I copy the original sheet and Paste Special Format, the format of column width does not transfer. I know I can save a copy of the workbook or worksheet and then open it. I then can clear the data in the new sheet and rename it. Is there a simpler and more direct way? -- Sam Conserva...

Pass table data from Access to a C dll and get it back
Hi, I want to pass a table's data into C code for further processing and get the processed data back into another table in Access. I have seen sample code in C++ opening an Access db and using automation on it. However, this is not permitted in my case; the driver application has to be Access itself. So maybe I have to pass the data into VBA and then further into the C code? Sample code for this anyone? Just a simple table with a few columns (properties) will do. TIA, Nikolas "rdrnws" <rdr@nws.com> wrote in message news:fh9nfp$rpo$1@aioe.org... > Hi, I want to ...

open attachment
Im using an IMAP account. When I have an attachment open, and then change emails in outlook to view another email, Outlook decides to create a second copy of the email with the open attachment, and "mark for deletion" the first email. In doing to Outlook locks up as the copy is created and uploaded to my IMAP server. Does anyone know how to stop it doing this? Im using Outlook 2003. Many thanks!! G. Don't open an email from within outlook - save it to the hard drive first. Or get in the habit of closing the attachment before changing messages. Also, make sure you have all ...

Use Same Variable multiple times in a query with different criteri
ok i have this variable i am trying to use twice with different criteria and it doesnt work help after i do with i want to count them November: Date_mailed (Variable Name) tblRecruitment2 (Table name) Between #11/1/2009# And #11/30/2009# (Criteria) October: Date_mailed tblRecruitment2 Between #10/1/2009# And #10/31/2009# I think you want to count? If so, set the E looking button on your tool bar, which turns on the Group ON feature then change the Group On to count. -- Milton Purdy ACCESS State of Arkansas "BZboarding101" wrote: ...

How to create digital cert from SelfCert.exe?
For office 2003, when I try to create a new digital cert from selfcert, I get following error, does anyone have any suggestions on how to solve it? Thanks in advance for any suggestionsE Eric "An error occurred while establishing digital cert Selfcert can not establish your digital cert" Have you read my reply to your posting of a couple days ago? 26cbt5hgehtiklhr07bijubrq2qihl888v@4ax.com Gord Dibben MS Excel MVP On Tue, 27 Apr 2010 08:30:02 -0700, Eric <Eric@discussions.microsoft.com> wrote: >For office 2003, when I try to create a new digital...

Excel Microsoft query
Hi I have a few queries, 1. Can a .txt file be joined to another database table? 2. Can I join a two tables in different sheets in the same workbook? 3. I tried to query a table on Excel sheet using the source as Excel Files*, but a field populated with numbers returned blank cells as the results. Why? ...

Auditing Select Queries , so that the full query is logged
Hi, I currently looking into auditing, we want to see who (and when) has viewed/updated patient information on our database. (I am using SQL Server 2008 and our application is developed in VS 2008). I have set up an audit , and a database audit to log any selects for our patient table. However instead of showing the full select statement i.e. select top 1 * from patient where patientnumber = 111111 it is showing select top 1 * from patient where patientnumber = @1 So i also enabled change tracking on the database, this was great if i entered the query in management s...