how to connect sql express 2005 through asp?

  • i want to connect sql express through asp 3.0 but unable to do it..

    Please help me!!!

    I am connecting it through system DSN.

    Please tell me the procedure for the connection.

    Thanks,

  • i want to connect sql express through asp 3.0 but unable to do it

    What error message you are getting?

  • sonashah_2190 (11/16/2008)


    i want to connect sql express through asp 3.0 but unable to do it..

    Please help me!!!

    I am connecting it through system DSN.

    Please tell me the procedure for the connection.

    Thanks,

    try like the following:

    * enable TCP/IP ports, using SQL Server Surface area configuration.

    * create the system dsn.

    * use the dsn name into your application.

    Note: in SQL 2005 use sql native client, if sql 2000 and earlier version, use oledb provider.

  • sonashah_2190 (11/16/2008)


    i want to connect sql express through asp 3.0 but unable to do it..

    Please help me!!!

    I am connecting it through system DSN.

    Please tell me the procedure for the connection.

    Thanks,

    normally the same connectionstring is enough that you were using previously. but for more connectionstrings you can follow this link::

    http://www.connectionstrings.com

    kshitij kumar
    kshitij@krayknot.com
    www.krayknot.com

  • Hi,

    Is it a Named Instance or Default Instance to which you are connecting? Normally you will get issue in named instance if SQL Browser is having issue.

    Try out below article to resolve this issue.

    http://www.sqlserverdba.co.cc/2008/10/sql-server-not-found-or-does-not-exist.html

    Incase still you are facing problem, Please reply here...

    Regards,
    Sakthi
    My Blog -> http://www.sqlserverdba.co.cc

  • this is my asp code:

    dim connection,qry,rs

    set connection=CreateObject("ADODB.Connection")

    connection.ConnectionString = "DSN=asp"

    connection.open()

    qry="insert into tbl_registration values(' " & name & "','" & address & "','" & city & "', '" & state & "','" & dob & "','" & email & "','" & uname & "','" & pswd & "','" & profession & "' )"

    set rs=connection.execute(qry) <- the error is here

    connection.close()

    set connection=NOTHING

    The error is as follows:

    Error Type:

    Microsoft OLE DB Provider for ODBC Drivers (0x80040E37)

    [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'tbl_registration'.

    /ASP/registration.asp, line 32

  • Invalid object name 'tbl_registration'

    The error message is clearly saying that the table is not found.

    I think you are not pointing to the right database.

    What is the default database? In the System DSN did you specify the database name?

  • ya i hav used system dsn only.Following are the steps

    i had open the ODBC Data Source Administrator,select the system DSN,

    given the name as "asp"

    then at server at had write "SONA-41A95F36C1"

    n select SQL Authentication n disable the username,password option.

    then 2 times next and then finish

    test the connectivity.

    Is all the above steps are perfect?

  • then 2 times next and then finish

    test the connectivity.

    Is all the above steps are perfect?

    No.

    Check "Change the default database to" then select the correct database from drop down list in the last but one dialog box.

  • But there is no option in the default database drop down?

  • Option is available to change the default database.

    See the attachment.

  • You can also fix this problem by prefixing database name to the table name in the query as follows:

    qry="insert into DatabaseName.dbo.tbl_registration values(...

  • There is no option like the picture has.

    Even it has not solve the problem by changing the query problem

  • Another option, try qualifying the table with database.schema.tablename to see if this resolves your issue. It appears the DSN is getting to the server just fine.

Viewing 14 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic. Login to reply