Search results

  1. W

    Lost Thread - CASE Statement Returns Null Values

    I finished typing this response; only to find the thread gone. If it helps the OP then here goes ... Kheribus, If your case statement may return NULL on several conditions: CASE WHEN ecsss.transportation.private_program IS NOT NULL THEN (SELECT cluster_name FROM...
  2. W

    Subform Events

    I've got a coworker that is developing an app. He's trying to dynamically assign a subform's RecordSource. He swears that (through Google) the only events available are the OnEnter and OnExit events. That's true for the subform control itself, but the FORM itself does support them. I briefly...
  3. W

    VBA Compiler Quirks

    I have a question about the mechanics of the VBA compiler. A coworker of mine meant to type: strX = RTrim(strY) Instead he typed: RTrim(strX + strY) This was accepted by the compiler and actually ran fine. The strings were evaluated as not equal and returned an RTrim of "False". The...
  4. W

    MS Access Linked Table Bloat

    I have a coworker with a Local Access 2007 table and an identical table linked to SQL Server 2000. The SQL Server table is empty and the Access table has 1,500,000 rows. If he opens Windows Task Manager and watches while this executes: CurrentDb.Execute "Insert Into SqlServerTable Select *...
  5. W

    Stored Procedure Compilation

    Hello, I have a SQL Server 2000 instance that has started behaving differently when saving Stored Procedures. In the past, when saving an SP, it had to be correct in both syntax and references to objects. If there was a syntax error, or an object did not exist, the SP wouldn't save. That was...
  6. W

    Select Count(*) Returns 0

    Hello, I have an Access Front-End utility that simply fills tables with BCP data and counts the rows. It has worked forever with no problems. sql = "Select Count(*) As HowMany From " & RTrim(Me.TableName) rst.Open sql, DbConnection RowsFound = rst!HowMany In this one particular database...
  7. W

    Help with Rand() Function

    I need help with the Rand() function in TSQL. I needed to return a random 20% of the rows from a certain table. On the surface it seemed that I could use the identity column for the seed and check for Rand() between 0.1 and 0.2. However, Rand(id) returns a very SEQUENTIALLY NUMBERED set of...
  8. W

    SQL Server 2008 Insert Problem

    Hello All, We're migrating to SQL Server 2008 and have run into an interesting problem. We have two databases: 1) Main production database; contains all tables, SPs, views, etc. for the app. Size is roughly 300 megabytes. 2) Support database; used to accept data for updates of main database...
  9. W

    Currently Running Access Instances

    Hello All, At work we're running Windows XP and Access 2007. I generally have multiple Access apps open at any given time. Here's the problem ... when I open a new Access App, Windows wants to open the "minimized" applications MAXIMIZED! I really don't like this. I've written apps that use...
  10. W

    Recover VBA Code From Corrupted DB

    Hello all, A coworker was developing an app to read XML files and had it working quite well ... until he read over 2GB of data and the database went "brain dead". He did have several backups, but all over a month old. None of the usual fixes; /Compact, /Repair, importing to a new DB, etc. are...
  11. W

    Life As A Non-DBA

    Hello all, At work we've been using SQL Server 2000 for quite a few years. We are looking to transition to SQL Server 2008 soon, but we'll have to move off OUR OWN server and move onto the IT folks' server. We won't be DBAs anymore (no sa privileges). Initially forays into this arena with...
  12. W

    .BAK or .MDF Files

    Hi all, We're migrating to SQL Server 2008 from Server 2000 and everything looks OK so far. In the past, we've represented all of our database releases in .BAK files. To research issues (or calculate data differences) we just restored the databases and did what we have to. I take it that...
  13. W

    DSN Default Database Changes

    We have a bunch on "dumb" engineers who link to SQL Server with a User DSN. For "some" reason (over the weekend) the Default Database changed from DatabaseA to DatabaseB in all of their DSNs! The only abnormal activity was that one of the IT folks detached DatabaseA. Could this have cause it...
  14. W

    Finding Number Of Rows In A Query

    Hello All, I have a Query that has 5218 rows. I just wanted to display the row count on a form. DCount("[SomeField]", "TheQuery") returns --> 5095. DCount("*", "TheQuery") returns --> 5095. There are NO Nulls in [SomeField] ! That doesn't seem right at all. Additionally, the query contains...
  15. W

    Query Produces Incorrect Results

    I ran into something weird with a set of queries today. I have a main query that retrieves data from about 8 other queries. It uses a main table for the shape of the "report" and fills in the details with left-joins from the other queries. Individually, the other queries work fine. MT = Main...
  16. W

    Linked Table Blocks Truncate Operation

    I have an Access Front-End with one SQL Server table linked. There is a stored procedure that performs two operations: 1) Truncate Table ThatTable 2) Insert Into ThatTable Select * From ... If the Access front-end is open, the process that presides over the linked table "blocks" the stored...
  17. W

    Excel Still Running

    Hello All, I have an Access 2007 app that instantiates an instance of Excel, opens a spreadsheet and populates various cells with Access stuff. So far, so good ... But even if the user saves/exits Excel, the Excel instance keeps running. Even if the Access VBA code does a quit, Excel keeps...
  18. W

    Happy Birthday Miles

    Happy Birthday Stewart, Hope you had a good day over there. You're wise beyond your years. Wayne btw, When's your other Birthday (Vassago's)?
  19. W

    Dynamic SQL Returning Value(s)

    The following "Action query" works: Declare @sql Varchar(200) Declare @DB Varchar(50) Set @DB = 'SomeDatabase' Set @sql = 'Insert Into ' + @DB + '..SomeTable From SomeTable' Execute @sql I can vary the database ... no problem. But, if I need information returned like: Set @sql = 'Declare...
  20. W

    Cursor With Dyncamic SQL

    I've got "one last hurdle" on a project. Background: 1) User creates/modifies a few rows of data in "TableA" in Database A. 2) I round up the data, use BCP and a Format file to export it. 3) Database B imports the subset of data into a temp table "t_TableA" 4) Since Database B has a...
Top Bottom