Update local table with Sybase ODBC data in update query

I need a couple of lines of code here. 

I have a linked Access97 table tblAccess, and a linked Sybase table tblSybase,
in my Access97 db.

I use a key field to link them. When I run the update query on these 2 tables
to update a field in tblAccess, I get a popup to log into Sybase, which must
be remedied in order to automate the process. I tried inserting a connection
string: ODBC;DSN=[DSN name];UID=[login];PWD=[pwd];DATABASE=[dbase];, in the
appropriate query property, but then it can't find tblAccess. I am running
this query from VBA, so how do I get this thing working?

Thanks,

Bill Reed

-- 
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

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

0
ragtopcaddy
11/21/2007 6:42:21 PM
access 16762 articles. 3 followers. Follow

4 Replies
1285 Views

Similar Articles

[PageSpeed] 20

I found a suggestion and took a couple of lines of code out of it:

strConnect="ODBC;DSN=" & strDSN & ";UID=" & strLogin & ";PWD=" & strPwd &
";DATABASE=" & strDB & ";"
Set dbODBC = OpenDatabase("", False, False, strConnect)

It didn't work. There was no error, but I still got the login dialog after
running these 2 lines.

ragtopcaddy wrote:
>I need a couple of lines of code here. 
>
>I have a linked Access97 table tblAccess, and a linked Sybase table tblSybase,
>in my Access97 db.
>
>Bill Reed
>

-- 
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

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

0
ragtopcaddy
11/21/2007 7:54:37 PM
The easiest solution is to create a passthrough query with the Correct 
connection string & open a recordset on that first

HtH

Pieter

"ragtopcaddy via AccessMonster.com" <u9289@uwe> wrote in message 
news:7b8f289ae7453@uwe...
>I found a suggestion and took a couple of lines of code out of it:
>
> strConnect="ODBC;DSN=" & strDSN & ";UID=" & strLogin & ";PWD=" & strPwd &
> ";DATABASE=" & strDB & ";"
> Set dbODBC = OpenDatabase("", False, False, strConnect)
>
> It didn't work. There was no error, but I still got the login dialog after
> running these 2 lines.
>
> ragtopcaddy wrote:
>>I need a couple of lines of code here.
>>
>>I have a linked Access97 table tblAccess, and a linked Sybase table 
>>tblSybase,
>>in my Access97 db.
>>
>>Bill Reed
>>
>
> -- 
> Bill Reed
>
> "If you can't laugh at yourself, laugh at somebody else"
>
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access/200711/1
> 


0
Pieter
11/22/2007 3:43:41 PM
Thanks Pieter,

That worked great with a stored query. How do I create this query in VBA?

Thanks,

Bill

Pieter Wijnen wrote:
>The easiest solution is to create a passthrough query with the Correct 
>connection string & open a recordset on that first
>
>HtH
>
>Pieter
>
>>I found a suggestion and took a couple of lines of code out of it:
>>
>[quoted text clipped - 12 lines]
>>>
>>>Bill Reed

-- 
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

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

0
ragtopcaddy
11/26/2007 3:05:04 PM
Dim Db As DAO.Database
Dim Qdef As DAO.QueryDef
Dim Rs AS DAO.recordset
Set Db = Access.CurrentDb()
Set Qdef = Db.CreateQueryDef(VBA.vbNullString,VBA.vbNullString)
'Set Qdef = Db.CreateQueryDef("ConnectToSybase",VBA.vbNullString)

Qdef.SQL = "SELECT 'X'"
Qdef.Connect="ODBC;...."
Set Rs = Qdef.OpenRecordset(DAO.dbOpenSnapshot)
Rs.Close : Set Rs = Nothing
Qdef.Close: Set Qdef = Nothing
Set Db = Nothing

HtH

Pieter


"ragtopcaddy via AccessMonster.com" <u9289@uwe> wrote in message 
news:7bcb7ee3691dc@uwe...
> Thanks Pieter,
>
> That worked great with a stored query. How do I create this query in VBA?
>
> Thanks,
>
> Bill
>
> Pieter Wijnen wrote:
>>The easiest solution is to create a passthrough query with the Correct
>>connection string & open a recordset on that first
>>
>>HtH
>>
>>Pieter
>>
>>>I found a suggestion and took a couple of lines of code out of it:
>>>
>>[quoted text clipped - 12 lines]
>>>>
>>>>Bill Reed
>
> -- 
> Bill Reed
>
> "If you can't laugh at yourself, laugh at somebody else"
>
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access/200711/1
> 


0
Pieter
11/26/2007 3:17:29 PM
Reply:

Similar Artilces:

Problem with Script Updating
I am using a script to update the “1099 Type” field for Master Vendor table. The script basically is a basic if-then statement. This script is run “Before Document Commit” and it’s not updating correctly, its flip-flopping the results. When the script is set to run Before Document Commit I have the “Destination mapping” field “1099 Type” set to “Use Script”. Script below: If SourceFields("Send 1099") = "N" Then DestinationFields("Options.1099 Type").Value = 1 Else DestinationFields("Options.1099 Type").Value = 4 End If I have also tried this s...

pivot table with dynamic base data
hiya, im trying to create a pivot table where I can change my base data (inserting or deleting rows of data) and still have this reflected in the pivot table. My solution was to use entire columns as my range for input to the pivotTable, but this means including blank rows which seems to muck up the calculations. I cant think how else i can allow for new rows to be added to the base data anyone got any ideas how to do this? thanks loads for your help! You can use a dynamic range as the source. There are instructions here: http://www.contextures.com/xlPivot01.html bb wrote: > hiy...

Report problem
I have this report that shows all receipts from any given client. The total outstanding balance is then tallied in the report. For some, the total outstanding balance is $0. In this case, I don't want that person to show up in the report. Is there a way to omit them? I know I could do it it in the underlying query, but the only way I know to do it requires totaling everything in the query, which would eliminate the ability to show each receipt individually on the report. Thanks! Create a totals query that calculates the balance by client. Then add this totals query to your re...

Update for MS Money 2005?
I have Money 2005. Is there an update to MS Money for Canadian users? Thanks in advance for any answers. We need a bit more information! Are you having problems with M2005 or is this just a post-Christmas/New Year random query when you are trying to get away from the in-laws? -- Regards Bob Peel, Microsoft MVP - Money For unofficial FAQs see http://money.mvps.org/ or http://umpmfaq.info/ I do not respond to any emails that I have not specifically asked for. "Daniel" <Daniel@discussions.microsoft.com> wrote in message news:E86EAB89-21DE-4505-ACAD-647278D736BD@microso...

updating sheets based on data in first sheet
Another payroll question, I have a workbook that contains 26 sheets, one for each bi-weekl payroll period. I would like to set it up so when i add a new employe the rest of the sheets also update automatically with that employee name and information. I have been able to acheive this to a limited degree using th =sheet1!a1 formula, but this only updates the info in the first cel and particularly the first column. I would like to acheive this using the first sheet, since at th end of the year I would like to be able to calculate ytd figure easily. Thank -- Message posted from http://www.Exc...

Error: Can't clean up the following tables: PriceLevel. 02-13-05
Hello all, using CRM 1.2 on a win2k3 server we get this error in the application event log: Source: MSCRMDeletionService Event ID: 5895 - Error: Can't clean up the following tables: PriceLevel. Category: none User: n/a Computer: our_exchange_server ooppps, I forgot, of course many thanks in advance for any tip! ...

Publisher 2007 and Microsoft Updates
I created a newsletter yesterday - everything fine - use Publisher all the time. Then an automatic update came down this morning and I can't open the file - it says "Publisher cannot open file" Other documents in Publisher are opening - any ideas? http://support.microsoft.com/kb/972566/ -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "Kim" <Kim@discussions.microsoft.com> wrote in message news:8754339B-99DC-4D09-83AD-6B34D8215274@microsoft.com... >I created a newsletter yesterday - everythin...

Microsoft Update only updates Windows Defender
iacrosoft Update only updates Windows Defender - I have to use Belarc Advisor to get a list of missing updates, and then go to the Microsoft Download Center to search for the missing updates and download and install them one at a time. I have Windows XP Home SP3, with Microsoft Update set to automatic download - can anyone tell me why I do not get all the necessary upadtes? Is this a sudden, new problem? When was Automatic Updates last working? Can you update manually via http://windowsupdate.microsoft.com? Any chance you've got a beta build of WinXP SP3 installed? What...

Data not being saved
Form is based on a combobox that pulls 1000s of records. The combobox record source is a query that is based on customer numbers. The form does not consistently save changes to records. However, if the same form is modified to pull only a single record (i.e., not based on a combobox of 1000s) then changes are saved. How are you making "changes to records" ... i.e., to more than one record at a time? Usually, a form displays a single record, and Access saves the changes when instructed, or when another record is called up. Regards Jeff Boyce Microsoft Office/Access MVP &...

Outlook data file check
Hello, I am using Outlook 2007 on XPSP2. Quite often on startup I get a message the Outlook is doing a file check and performance may be slow. I also often get on computer startup a message requesting me to send an error report to Microsoft that includes a few episodes of Outlook not responding. Any idea what this could be about and how to prevent both? -- Thanks, Bob ...

From temporary table to master table and then join this in junction table
Hello, I have imported two spreadsheets from excel to two temporary tables called "import_tbl_contract" and "import_tbl_products". I do this on daily basis and import many spreadsheets. I end up with these data: [import_tbl_contract] contract_number contract_title start_date end_date [import_tbl_products] product_number product_text price I now append these data to the following two tables: [tbl_contract] contract_id (PK) contract_title start_date end_date e.g. 1; Syringes and needles; 01-01-2010; 31-12-2010 [tbl_products] product_id ...

Excel 2010 Slicer Connection / Pivot Table Problem
Working in Excel 2010 beta. I have two pivot tables created from different SSAS cubes. I have PowerPivot add in installed, but not using it for this project. The two pivot tables both share several similar dimensions. When I try to connect a given slicer to both pivot tables, the 2nd pivot table is not available in the "Pivot Table Connections" window. The only pivot table listed in the "Pivot Table Connections" is the one for which the slicer was originally created. All of the posts I've seen so far say that all the pivot tables in the workbook should appear...

Update question
Soory if this is the wrong place to ask this, but cannot find a NG proper to Windows 7. I currently run Windows Vista and am getting tired of Vista's decision to tell me that it is going to shut down in less than a minute. So have decided to upgrade to Windows &. I note that I can purchase an upgrade versiom for 64 quid from Amazon or an apparently full version of Windows 7 Home premium for 89 quid. My question is this - If I buy the upgrade version will I only be able to load it on a new PC in the future if I already have windows Vista installed? i.e For any future cl...

How to drag a picture from html page and save to local computer #2
Hi, I had written an application with Microsoft Visual C++ 6.0(with sp5), I wanna drag a picture from html page and drop in my application, a dialog-based application, but I don't know how to set the clipboard format, CF_GIF?, and, If I can get a href-link for the picture, So my problem is addressed now. So..., I don't know how to do? Anybody can offer some articles or codes to help? Any help will be appreciated! Allen Chang See IDropTarget and other related interfaces. "Allen Chang" <zhangbwnewyork@hotmail.com> wrote in message news:%23sLdi25LFHA.3960@TK2M...

Outlook 2003 died mysteriously after update
Setup in a nutshell... System: Lenovo T500 laptop OS: Vista Business SP1 32-bit Software: Office Outlook 2003 SP3 Problem... So I'm using this setup for over a year, everything OK. Yesterday I did two things and now Outlook dies (quietly, sans error message) immediately after startup. It show the splash screen, displays my inbox, and *poof* disappears. What I did earlier... 1. Windows Update installed: KB9766662, KB979306, KB979099, KB975929 2. At the same time, while searching for another program to uninstall I stumbled upon (and uninstalled) Windows LIVE Toolbar and...

How update entity in post update?
I created a handler for Update post callout for Opportunity. I want update some fields of the opportunity on the PostUpdate. However, if I call the Update method of CRMOpportunity in the PostUpdate I will create a recursive post callout. Can somebody help me? Thank you for pay attention []'s Vin�cius Pitta Lima de Ara�jo You need to check the OrigObjectXML field to see what fields were updated and then act appropriately. Matt Parks MVP - Microsoft CRM ---------------------------------------- ---------------------------------------- On Wed, 4 Aug 2004 17:43:17 -0300, "Vin�cius ...

Merge into same document using different data sources
I have a template file that I use as a mailer. Each week I set up my merge fields and merge from an excel data file. The following week I want everything to look exactly the same but want to merge from a different excel list. I open the publication, tell it to proceed without connection to the datasource (my old list), choose tools, mail merge, use an existing list ... and all of my perfectly placed merge fields disappear! So every time I want to use another list I have to put my merge fields in again. My headers are the same in every excel file so mapping should not be a problem. ...

Data Labels xy scatter plot
I want to put a dot at 4,4 - 5,5 - 10,8 But want to label those points on the chart with the DATA ID column (e.g. 1a, 1b, 2e) - I can't figure it out, can someone point me toward the answer. Y Axis X Axis DATA ID 4 4 1a 5 5 1b 10 8 2e -Steve On Feb 24, 9:44=A0am, brittonsm <britto...@gmail.com> wrote: Hello: Try http://www.appspro.com/Utilities/ChartLabeler.htm This application should be able to do what you need. Pieter Vandenberg > I want to put a dot at 4,4 - 5,5 - 10,8 > > But want to label those points on the chart with the DATA ID column > (e.g. 1a, 1b, 2e)...

Cannot install update KB979906 for .NET Framework 1.1 SP1
Running : Windows XP media center edition SP3 Have tried installing KB979906 a few times and also downloaded update manually but cannot install this update. Receiving error 0x643.Is it safe to uninstall the .NET Framework 1.1 and re-install as possibly corrupt , without having to uninstall/re-install all other .NET frameworks 2 , 3 and 3.5 including the updates that go with them? .. Hello sherlockomes, you might want to look at the following kb article to see if this will help with the error 80070643. <http://windows.microsoft.com/en-US/windows-vista/Windows-Update-error...

latest update too MSCFV2
Hi, I have MSCFV2 version 6.5.7825.0. Could someone inform me if this is the latest download? Looks like you have 6.5.7825.0 from 05/21/2006, but there is a newer version - 6.5.7831.0 from 06/01/2006. C. Smith Enso Technologies, Incorporated http://www.ensotech.com On Tue, 13 Jun 2006 04:25:02 -0700, Paul <Paul@discussions.microsoft.com> wrote: >Hi, > >I have MSCFV2 version 6.5.7825.0. Could someone inform me if this is the >latest download? Christopher Smith csmith@ensotech.com Enso Technologies, Incorporated http://www.ensotech.com Also - meant to post this in t...

Print record once, update Yes/No field verifiying print
I would like to print a group of records, then have a Yes/No field [Printed] updated in my Jobs table with an update query showing the records were printed. Then next time the report runs, In my query criteria I will test for True values on the Yes/No field. Then only the records with the Yes/No field marked No will print. Any suggestions? Thanks Tommyboy,there's more to this question than meets the eye. For an explanation of what's involved, see: Has the record been printed? at: http://allenbrowne.com/ser-72.html The article includes a free sample database that dem...

putting data into multiple tables
Using Access 2002 and would like to enter data into form which will then send to fields in multiple tables and update them. Can this be done and how need basic explanation Why do you want to send the data to different Tables? If The Tables all belong to the same Database. ie you're not dealing with different back-end systems, you probably have a serious normalization problem. Data should normally only have to be in one table in a relational database. Pieter "Phillipa" <Phillipa@discussions.microsoft.com> wrote in message news:994354EC-1216-4EEB-9CA9-D9F0880B03C5@mic...

Data Migration Import
I am setting up the migration to only import the "Account" entity. I load the cdf table with all the required fields. When I run the migration it says everything was successful but no data is imported. What am I missing? ...

Anyone know how to Automatically transfer CSV data to Web page forms?
How can you populate a form fields on a html web page (client side) with data from an Excel file (CSV). The web page has several text fields for input that I manually populate. I would like to transfer the data into the web form automatically from the CSV file. How can this be done? TIA Jman -- --------------------------------- --- -- - Posted with NewsLeecher v3.7 Final Web @ http://www.newsleecher.com/?usenet ------------------- ----- ---- -- - Jman, I had some success using the SendKeys method in VBA. It wasn't a web form -- it was a terminal emulator -- but I think I did...

Dynamic Menu update
Hi All, I need to update a menu item dynamically, setting its SetCheck property to either true or false, based on a user operation. I am trying to do this from a custom function. Usually, the pCmdUI pointer is used. But how do I do it from another function? Thanks Your "other function" should change some setting. In your ON_UPDATE_COMMAND_UI handler, you should check that setting and call SetCheck as needed. -------------- Ajay Kalra ajaykalra@yahoo.com In addition to Ajay's response, this page may help you: http://msdn2.microsoft.com/en-us/library/6kc4d8f...