Results 1 to 22 of 22

Thread: [RESOLVED] is there a way to create a new field in an existing table that has password protecte?

  1. #1

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Resolved [RESOLVED] is there a way to create a new field in an existing table that has password protecte?

    i have a db called HairDesign and it is protected with a password of 123456
    now in this DB i have a table called BackArc
    is there a wat to create with vb another field?
    HairDesign.zip
    PassWord is 123456
    tnx in advanced
    salsa31

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: is there a way to create a new field in an existing table that has password prote

    Use the Alter Table method:
    Code:
    Alter table [table name]
    Add column [column name] [column type] [null|not null]
    just execute it like any other SQL statement against the database.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: is there a way to create a new field in an existing table that has password prote

    Hey
    tg
    just execute it like any other SQL statement against the database.
    can you give me a Start or something?
    do i need to Dim SomeThing?

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: is there a way to create a new field in an existing table that has password prote

    It's jsut a SQL statement. Nothing more. Nothing less. I KNOW you know how to execute SQL statements, you've got plenty of posts were that's been discussed. There's nothing special about it except it will not return a recordset.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: is there a way to create a new field in an existing table that has password prote

    Alter table [table name]
    Add column [column name] [column type] [null|not null]
    sry sir never done this before
    BTW the DB has a password 123456
    this is the SQL i know
    Code:
            StrSql = "Update PriceList set PriceStartTime ='0', PriceEndTime ='0'"
            CN.Execute StrSql

  6. #6
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: is there a way to create a new field in an existing table that has password prote

    If this is a Jet 4.0 (Jet OLEDB:Engine Type=5, a.k.a. "Access 2000/2002/2003 format") database then there are two types of "passwords."

    One is the simple caveman "database password" for share-level security and the other is a "user password" that varies by user when you are using proper Jet user & group role-based security.

    If you are using share-based security then it is merely a matter of supplying that password when you connect. The Connection Property is named "Jet OLEDB:Database Password" and you can set this in the connection string or separately via the Connection.Properties collection.

    The same is true for role-based security, but you have two properties "User ID" and "Password" to set.


    Once you have a connection opened with sufficient permissions you can add a column/field to the table either via ADOX or via Jet SQL DDL commands.

  7. #7

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: is there a way to create a new field in an existing table that has password prote

    hey sir this is what i use
    Code:
    Public Sub DataBaseConnectionSystem()
    On Error GoTo ErrMsg
            Set CN = New ADODB.Connection
            StrSql = "Provider=Microsoft.Jet.OLEDB.4.0;"
            StrSql = StrSql & "Data Source=" & App.Path & "\HairDesign.mdb;"
            StrSql = StrSql & "Jet OLEDB:Database Password=123456"
            CN.ConnectionString = StrSql
            CN.Open
        
    
    ErrMsg:
    
        End If

  8. #8
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,624

    Re: is there a way to create a new field in an existing table that has password prote

    You've already opened your database....simply do what tg said in post #2....simple.

  9. #9

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: is there a way to create a new field in an existing table that has password prote

    hey sami i dont know what to do sry

  10. #10
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: is there a way to create a new field in an existing table that has password prote

    Why do you always insist on making this harder than it needs to be? I know you know how to execute a SQL statement. The forums are littered with your posts regarding SQL commands... This is no different. A SQL statement is a SQL statement... you create a command object, set the command text on it, then execute it... plain and simple. There's no magic to it.

    And with that I'm done with this thread.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  11. #11
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,624

    Re: is there a way to create a new field in an existing table that has password prote

    Instead of just giving you the code, please look at this tutorial...it tells you EXACTLY how do to what you want to do.

    http://www.vb6.us/tutorials/access-sql

    Sammi

  12. #12

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: is there a way to create a new field in an existing table that has password prote

    Why do you always insist on making this harder than it needs to be? I know you know how to execute a SQL statement
    i know yes but this is diffrent
    Instead of just giving you the code, please look at this tutorial...it tells you EXACTLY how do to what you want to do.
    i just want a starter thats it

  13. #13

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: is there a way to create a new field in an existing table that has password prote

    Alter table [table name]
    Add column [column name] [column type] [null|not null]
    what is this?
    alter table?
    i dont understand Tg i am not playing around
    just asking how to do this thats all why is it so hard to help me?

  14. #14
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: is there a way to create a new field in an existing table that has password prote

    Alter table is one of many sql statements that can be used

    What you have been shown is clear and simple and while you may not have did this exact thing before it is the same as what you have done 1000 times only the text on the sql statement is different.

    Code:
    CN.Execute SQLStatement
    Alter means to change

    All you have to do is plug in the proper values for you table name, column name and such then execute it just like if it was an update query

  15. #15

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: is there a way to create a new field in an existing table that has password prote

    All you have to do is plug in the proper values for you table name, column name and such then execute it just like if it was an update query
    you mean like this sir?
    Code:
             Dim StrSql As String 
             StrSql = "Update Alter table [BackArc] Add [Remarks] [Memo]"
             CN.Execute StrSql

  16. #16
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: is there a way to create a new field in an existing table that has password prote

    Yes and no. Yes you use execute as you have been told a few times already. No you do not add update into the query.

    You added Update into the query and that does not go there.
    You were shown what the sql statement should look like and there was no Update any where in any of that.

    I said you execute just like you would an update query not that you should add update into it.

    To execute any query you use execute, It doesn't matter it it is a drop statement, an alter statement or the ones you are more used to like update, delete, insert. They are all sql statements and they are all executed the same way the only thing that is different is the actual text of the statement.

  17. #17

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: is there a way to create a new field in an existing table that has password prote

    Code:
    CN.Execute = "Alter table [BackArc] Add [Remarks] [Memo]"
    forget it sir i dont understand i just dont

  18. #18
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,624

    Re: is there a way to create a new field in an existing table that has password prote

    you were so close with:
    Code:
    Dim StrSql As String 
             StrSql = "Update Alter table [BackArc] Add [Remarks] [Memo]"          
    CN.Execute StrSql

    Now, look at this EXAMPLE (IN THE LINK I SHOWED YOU IN #11):
    Code:
    StrSql = "ALTER TABLE Customers  ADD COLUMN CustName TEXT 25
    can you take it from here? (Wish you had studied that tutorial!)

  19. #19
    Hyperactive Member
    Join Date
    Oct 2013
    Posts
    389

    Re: is there a way to create a new field in an existing table that has password prote

    Make it short.
    After defining the password in your 'CN' connection string Database Password=123456

    Build your query:
    Code:
    StrSql = "Alter Table [BackArc] Add Column [Field1] Text"
    Execute it:
    Code:
    CN.Execute StrSql
    Done.

    More fun to read information on table altering can be found here: http://www.w3schools.com/sql/sql_alter.asp

  20. #20

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: is there a way to create a new field in an existing table that has password prote

    hey stum what about the Db HairDesign?
    i dont see it in the query
    only the table

  21. #21

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: is there a way to create a new field in an existing table that has password prote

    Code:
        StrSql = "Alter Table BackArc Add Column Field1 Memo"
        CN.Execute StrSql
    tnx for your help amigos

  22. #22
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,624

    Re: [RESOLVED] is there a way to create a new field in an existing table that has pas

    Why would you name a field, "Field1"? Because it is a Memo field, maybe something like "Remarks" would be more suitable.

    Too bad stum showed you....was hoping you'd get the answer from the link (post#11)...you learn more by researching than simply taking others' code...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width