Vbscript error Object required:'server'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rathiagu
    New Member
    • Aug 2007
    • 14

    Vbscript error Object required:'server'

    the below is my part of


    set cn = Server.CreateOb ject("ADODB.Con nection")

    strCS = "Provider=Syste m.Data.SqlClien t; Data Source=" & _
    Server.MapPath( "management.mdb ")& ";"

    cn.open strCS

    cn.Execute "INSERT INTO contract_covera ge ([coverage_id], [contract_covera ge]) VALUES (1111,'hi')"
    cn.close

    when executed the error "OBject required:'serve r'" occurs in the first line. I am not sure why this occurs.Can please anyone help me?
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Moved to Visual Basic forum.

    Comment

    • QVeen72
      Recognized Expert Top Contributor
      • Oct 2006
      • 1445

      #3
      Originally posted by rathiagu
      the below is my part of


      set cn = Server.CreateOb ject("ADODB.Con nection")

      strCS = "Provider=Syste m.Data.SqlClien t; Data Source=" & _
      Server.MapPath( "management.mdb ")& ";"

      cn.open strCS

      cn.Execute "INSERT INTO contract_covera ge ([coverage_id], [contract_covera ge]) VALUES (1111,'hi')"
      cn.close

      when executed the error "OBject required:'serve r'" occurs in the first line. I am not sure why this occurs.Can please anyone help me?
      Hi,

      Somewhat confused here.. You have mentioned provider as SQL Client, but are refering to an Access DB.
      ConnString for Access is :

      "PROVIDER=MICRO SOFT.JET.OLEDB. 4.0;DATA SOURCE=" & Server.MapPath( "mydatabase.mdb ")

      Regards
      Veena

      Comment

      • rathiagu
        New Member
        • Aug 2007
        • 14

        #4
        hi QVeen72,
        Thanks for ur reply.i found ou the error ,the eroor was due to Server.Createob ject line, because i was running the script from windows and so it must be Wscript.Createo bject.Sorry for wasting all of your time.Thank you Again QVeen72

        Originally posted by QVeen72
        Hi,

        Somewhat confused here.. You have mentioned provider as SQL Client, but are refering to an Access DB.
        ConnString for Access is :

        "PROVIDER=MICRO SOFT.JET.OLEDB. 4.0;DATA SOURCE=" & Server.MapPath( "mydatabase.mdb ")

        Regards
        Veena

        Comment

        Working...