Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2004
    Posts
    13

    Unanswered: How to start using MSDE

    I have spent megabucks buying a book called MSDE Bible and they have started the book by not telling how you create a database (with all the exact steps required so you can actually work with it. I find this highly unprofessional, and wonder if the authors David C Walls and Denise M Gosnell actually know anything about teaching. (One enormally teaches step 1 before step 2 where I come from - obviously not in some places). Anyway, later on in the book there is an example on creating a database.

    My problem is that it does not work because I do not understand what is required in terms of security clearance / user names / passwords / user authority. (They also assume you know all about that too).


    All I have done is installed MSDE 2000 Rel A and am now trying to use it. The only question I was asked during the install was to define a "Strong Password" and thats all.

    I am now attempting to

    1) Create a Database
    2) Create a table with some fields
    3) See if I can access the database

    Now is that too much to ask ?


    Here is the code that supposedly creates the database:

    The problem is in the connect - something to do with security of some sort that is completely overlooked.



    dim oMSDEserver
    dim oDatabase
    dim oDataFile
    dim oLogFile

    set oMSDEserver = CreateObject("SQLDMO.SQLServer")
    set oDatabase = CreateObject("SQLDMO.Database")
    set oDataFile = CreateObject("SQLDMO.DBFile")
    set oLogFile = CreateObject("SQLDMO.LogFile")

    oDatabase.Name = "scheduling"

    oDataFile.Name = "sched_data"
    oDataFile.PhysicalName = "c:\mssql7\data\sched_data.mdf"
    oDataFile.Size = 5

    oLogFile.Name = "sched_log"
    oLogFile.PhysicalName = "c:\mssql7\data\sched_log.ldf"
    oLogFile.Size = 3
    oLogFile.MaximumSize = 50

    oDatabase.Filegroups("PRIMARY").DBFiles.add(oDataF ile)
    oDatabase.TransactionLog.LogFiles.add(oLogFile)

    oMSDEserver.connect "0kh2h","sa","" <<<<<< PROBLEM HERE
    oMSDEserver.databases.add(oDatabase)
    oMSDEserver.disconnect





    I have not done anymore than install MSDE and run this code - what steps have I missed please ???

    Please explain this simply for me.

    (I understand DAO / ADO and Access programming but have never used DSN's and SQL Server connections)

  2. #2
    Join Date
    Oct 2001
    Location
    England
    Posts
    426
    That's trying to connect using sql server security and a blank sa password. (did you define a password at installation?)
    The blank password is very bad and it has probably been installed for windows security only.
    To change to mixed security change the registry entry

    HKLM/Software/Microsoft/MSSQLServer/MSSQLServer/LoginMode
    = 1 integrated security, 2 mixed.

    The key path made not be exactily this in your installation.
    This should allow sa connections with a blank password.

    You also might want to look at osql as an easier way of administering msde.

  3. #3
    Join Date
    Apr 2004
    Posts
    13
    All I have done is installed MSDE 2000 Rel A and am now trying to use it.

    The only question I was asked during the install was to define a "Strong Password" and thats all.

    There must be a logical next step to take.

    I can understand one may need to get in and change registry settings, but all I can say is that in 30 years of installing systems, I have never had to go to the registry immediately as the next option.

    Is this because there is a massive limitation in administrering MSDE?

    The must a simple next step.

    Now why on earth would I think that?

  4. #4
    Join Date
    Apr 2004
    Posts
    13
    There doesn't seem to be a Login mode option in the registry

  5. #5
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    I think the step you might be missing is that you need to connect to an existing database server to create your new database. The MSDE doesn't include a database server, it just lets you connect to an existing one and create/modify databases.

    Do you have an existing database server?

    [I'm a moron, ignore this post]
    Last edited by rokslide; 04-05-04 at 03:14.

  6. #6
    Join Date
    Apr 2004
    Posts
    13
    i THOUGHT msde WAS THE DATABASE SERVER

    IE, CUT DOWN VERSION OF sql sERVER

    On completion of the installation I am left with a number of databases in
    the Install Data Directory

    Master.mdf
    Model.mdf
    TestDb.mdf
    Msdblog.mdf
    Msdbdata.mdf

    The Taskbar shows that the server is running
    ie, same icon as sql server

    Services are: SQL Server

  7. #7
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    Opps, sorry, I'm getting myself confused.... a million apologies (curse Monday and all it's distractions). Let me think more about it and I will try again....

  8. #8
    Join Date
    Nov 2003
    Location
    Romania
    Posts
    70
    You can use:
    1. MSAccess to create a DataBase (adp file)
    2. www.laplas-soft.com
    3. http://www.synametrics.com/SynametricsWebApp/WinSQL.jsp

    /**********************************************/
    to connect to a database in VB

    Public cn As New ADODB.Connection
    Public SirConectare_SQL As String
    '------------------------------------------------------
    SirConectare_SQL = "PROVIDER=SQLOLEDB.1" & _
    ";Integrated Security=SSPI" & _
    ";Persist Security Info=False" & _
    ";Initial Catalog='" & DataBaseName & "'" & _
    ";Data Source='" & ServerName & "'"

    With cn
    .ConnectionString = SirConectare_SQL
    .Open
    .CursorLocation = adUseClient
    End With

    Dim rs As New ADODB.Recordset
    rs.Open "SELECT * FROM YourTable", cn, adOpenStatic, adLockReadOnly

    Do While Not rs.EOF
    msgbox rs(0)
    rs.MoveNext
    Loop

    rs.close
    SET rs = Nothing

    cn.close
    SET rs=Nothing

Posting Permissions

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