Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
  1. #16
    mountainclimber is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    56
    Quote Originally Posted by orange View Post
    What happened? Error message??

    Here is a M$oft example
    I beat you to it. That is how I created the Alter Table statement in the first place: by copying that link. See my recent post.

    Any ideas why my alter table statement isn't working?

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Has Ticker field been defined as PK in tbl0?

    That links says ADD CONSTRAINT is to 'add a multiple field index', has nothing to do with associating PK/FK data. Eliminate that clause and see what happens.

    I still don't understand how the FOREIGN KEY and REFERENCES clauses will 'know' which Ticker from tbl0 goes with which record in tbl1 thru tbl5 and correctly populate field.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #18
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Can build relationships in Relationship Builder if you want. This means when you create a query, the link will automatically establish.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #19
    mountainclimber is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    56
    Quote Originally Posted by June7 View Post
    Has Ticker field been defined as PK in tbl0?

    That links says ADD CONSTRAINT is to 'add a multiple field index', has nothing to do with associating PK/FK data. Eliminate that clause and see what happens.

    I still don't understand how the FOREIGN KEY and REFERENCES clauses will 'know' which Ticker from tbl0 goes with which record in tbl1 thru tbl5 and correctly populate field.
    I tried this:
    Code:
    db.Execute "ALTER TABLE tbl1 " _
            & "FOREIGN KEY (TickerID) REFERENCES tbl0 (Ticker);"
    ...and I get:
    "Syntax error in ALTER TABLE statement.
    Last edited by mountainclimber; 07-07-2015 at 01:29 PM. Reason: typo

  5. #20
    mountainclimber is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    56
    Quote Originally Posted by June7 View Post
    Can build relationships in Relationship Builder if you want. This means when you create a query, the link will automatically establish.
    I need to do this in VBA every day.

  6. #21
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Do what in VBA every day - build relationships in Relationship Builder?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #22
    mountainclimber is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    56
    Quote Originally Posted by June7 View Post
    Do what in VBA every day - build relationships in Relationship Builder?
    I take in data that changes, determine data types, create schema.ini file, divide data up, import it, create tables and relationships.

  8. #23
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Why would you have to create new tables as opposed to appending to existing tables? Why would data structure be dynamic? Not all from the same source? If this is not related data, why all into one database file?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #24
    mountainclimber is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    56
    Quote Originally Posted by June7 View Post
    Why would you have to create new tables as opposed to appending to existing tables?
    Because, for now, each table represents a date. I eventually drop these files and use a time series table.

    Quote Originally Posted by June7 View Post
    Why would data structure be dynamic?
    Because users have the ability to change the source data and what it looks like. I am handling this with a schema.ini file in the same directory.

    Quote Originally Posted by June7 View Post
    Not all from the same source? If this is not related data, why all into one database file?
    Because opening Excel files each time I want to access data is super slow. What alternative do you suggest? There is some related data, but 95% of it is not.

  10. #25
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Users change data source and its structure? Never encountered such a situation. If I understand, you want to programmatically build a database file from scratch. Sorry, no experience with what you are attempting. No idea how to use schema.ini file.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #26
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    @mountainclimber

    You really have to pin down the scope of the issue before you, and get management or whoever has given you this to resolve, to sign off with the scope/requirements. Relational database is not the tool if you have a different table definition every day. As they say, if you can't describe/define the issue, then nobody can build it.

    If the requirement really is this variable, then you need to train others in ad hoc database retrieval and programming. You also may want to do some analysis of the source and format and need of this information.

    You need a clear set of requirements in plain English. From there you can do some analysis and come up with some options. You may want to research relational database design just to refresh some concepts.

    You may find you need some sort of template that can be driven from a series of inputs to create the structure/commands you need to do the job. But readers are not nearly as familiar with your set up and needs as you are. And we are still guessing at how most of what you have said fits together and could be resolved or supported with Access.

    Good luck.

  12. #27
    mountainclimber is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    56
    Quote Originally Posted by orange View Post
    @mountainclimber

    You really have to pin down the scope of the issue before you, and get management or whoever has given you this to resolve, to sign off with the scope/requirements. Relational database is not the tool if you have a different table definition every day. As they say, if you can't describe/define the issue, then nobody can build it.

    If the requirement really is this variable, then you need to train others in ad hoc database retrieval and programming. You also may want to do some analysis of the source and format and need of this information.

    You need a clear set of requirements in plain English. From there you can do some analysis and come up with some options. You may want to research relational database design just to refresh some concepts.

    You may find you need some sort of template that can be driven from a series of inputs to create the structure/commands you need to do the job. But readers are not nearly as familiar with your set up and needs as you are. And we are still guessing at how most of what you have said fits together and could be resolved or supported with Access.

    Good luck.
    Thank you. This effort it super complex and ultimately proprietary. There is way too much to it to explain here; however, I do have it scoped out. I work for a hedge fund. I just ask specific technical questions that I hope stay narrow. Sometimes that doesn't workout....like here. Thanks all.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 04-22-2014, 11:09 AM
  2. Indexing (no dupes) dates where employee code = XXXX
    By snipe in forum Database Design
    Replies: 4
    Last Post: 12-12-2013, 03:19 PM
  3. Indexing question
    By Helystra in forum Database Design
    Replies: 8
    Last Post: 11-22-2013, 04:24 PM
  4. Replies: 1
    Last Post: 09-03-2013, 07:30 AM
  5. Looking for a strategy
    By 10 Gauge in forum Access
    Replies: 1
    Last Post: 08-29-2011, 09:03 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums