Connecting To Sqlexpress From Classic Asp

Apr 28, 2006

hi,i'm using classic asp to try and connect to a sqlexpress database on a development server. i get the following error:


Microsoft OLE DB Provider for SQL Server (0x80004005)
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
/dbtest.asp, line 8

I'm using the following script which runs fine against a regular SQL server (version 8) on the network.

<%@LANGUAGE="JAVASCRIPT"%>

<%
var strCon, conn, sql;

strCon = "Provider=SQLOLEDB.1;Data Source=localhost;Initial Catalog=rapidHB;User Id=rapid;Password=xxx";
conn=Server.CreateObject("ADODB.Connection");
conn.Open(strCon);

sql = "SELECT product_code FROM products WHERE product_type = 1";

var results= conn.Execute(sql).GetString();
Response.write(unescape(results));
%>

I have tried changing Data Source to servernameSQLEXPRESS, changing initial catalog to master, using a user name defined on the database and changing the provider to SQLNCLI but nothing has worked.

Anyone got any idea what I'm doing wrong? Using ASP.Net is not an option.

Rgds,

lukemack

View 9 Replies


ADVERTISEMENT

Connecting To SQLExpress From Classic ASP.

Nov 16, 2005

Migrating a site to a new server. Moved data to SQLExpress. Changed connection string to point to SQLExpress and now I am getting this error.
Microsoft OLE DB Provider for SQL Server error '80004005'
Cannot open database "PHCSQL" requested by the login. The login failed.
/func/inc_DatabaseFunctions.inc, line 5 Do I need to do permissions differently than MSDE?Did connection strings change?Help?

View 1 Replies View Related

Connecting To SQL Server Express Via ASP (classic)

Aug 31, 2007

Hi All,

I'm having trouble getting at SQL Server 2005 Express via ASP code.

I'm using the following connection string in my ASP code:

Set objConn = Server.CreateObject("ADODB.Connection")
objConn = "Provider = SQLNCLI;" & _
"Data Source = .SQLEXPRESS;" & _
"Initial Catalog = myDB;" & _
"User ID = DB_reader;" & _
"Password = a#koddkobn5;"

I keep getting the error:

Microsoft SQL Native Client (0x80004005)
Login failed for user 'DB_reader'. The user is not associated with a trusted SQL Server connection

I have made sure that the user exists in SQLEXPRESS and that server Security is set to SQL Server and Windows Authentication mode.

Can anyone think of anything I'm missing or that I should try?

We've lost our SQL Server admin and I'm trying to develop locally using Express while we hunt for a new admin.

Thanks so much for any assistance you have time to offer.

Very best,

Thom Cox

View 9 Replies View Related

Connecting To SQL Server 2005 From Classic ASP

Aug 3, 2006

I am trying to return multiple recordsets to a classic ASP web page from SQL Server 2005 and then use GetRows() in ASP to fill 2 arrays with the data. I'm using a command object to run a stored procedure which performs 2 simple selects in SQL Server. The stored procedure works fine in SQL Server Management Studio so I'm guessing it's an ADO issue.

The ASP code looks like this: strConnect = "DRIVER={SQL Native Client};SERVER=MyServer.IsAtMyIsp.com;DATABASE=MyDb;UID=Me;PWD=MyPwd; MARS Connection=True;"

Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = strConnect
conn.Open

Set objCommand = Server.CreateObject("ADODB.Command")
Set objRecordset = Server.CreateObject("ADODB.Recordset")
Set objRs = Server.CreateObject("ADODB.Recordset")

With objCommand
.ActiveConnection = conn
.CommandText = "sp_GetShowList"
.CommandType = adCmdStoredProc

If Len(strBeginDate) And IsDate(strBeginDate) Then
.Parameters.Append .CreateParameter("@i_DateStart",adDate,adParamInput,,strBeginDate)
If Len(strEndDate) And IsDate(strEndDate) Then
.Parameters.Append .CreateParameter("@i_DateEnd",adDate,adParamInput,,strEndDate)
End If
End If
End With

Set objRs = objCommand.Execute

arrEvents = objRs.GetRows()
objRs.NextRecordset
arrSched = objRs.GetRows()

The error message below occurs at the 2nd GetRows() command. Operation is not allowed when the object is closed.

Can anyone tell me what I might be doing wrong?

-Dan

View 3 Replies View Related

Connecting To SqlExpress

Apr 17, 2008

As of right now I have two networked machines. I have a sql database on one that I have no problem connecting to, but I cannot connect to the database from the second machine.

From the second machine, I've come up with this connection string after all my research...

"server=[MACHINE_NAME]SQLExpress;databse=[NAME];User ID = sa;Password=[PASS]"

I keep getting a cannot connect to database error.

Any ideas?

View 5 Replies View Related

Problem Connecting To Sqlexpress

Jul 29, 2006

Hi all,

I'm getting this error message from the ASP.NET configuration manager in VS 2005 Pro:

There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may help in diagnosing the problem: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.

I have no problem connecting using the sql server management studio tool.

I need help ASAP, can't afford the down time.

Thanks,

Andy

View 1 Replies View Related

Connecting To The SQLEXPRESS On Your Computer

Oct 2, 2006

How do I connect to the SQLEXPRESS installed on my computer without network connection (as a standalone computer)?

Thanks.

View 5 Replies View Related

Connecting SQLExpress &&amp; Visual C# 2005

Nov 13, 2006

Hi

I have started to create a databse using SQL Server Management Studio Express, just a few tables, one with data. I now want to creat a some windows forms to populate the tables. However when I try to use the Add New Data Source wizard, I get an error when I try to create the connection string, but I have managed to connect to a copy of AdventureWorks located in the same parent directory.

Error is :
Unable to open the physical file "...". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".
An attemp to attach an auto-named database for file ... failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

As I can connect to AdventureWorks, I presume Windows thinks the file is open, but I have no idea why, how to check, or how to close it.

TIA

Graham

View 1 Replies View Related

Problem With Connecting With Sqlexpress 2005 On My Host

Jul 9, 2006

Hi

I have a problem with sqlexpress

I'm using sqlexpress 2005 with asp.net 2 and all things work in my computer good

but when i upload it on the internet in my host it return this error :

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

I am using sql server locally and i'm not using it remotly

i just created a simple page (just have a detailsview) and upload it to the internet

and then upload my mdf and ldf files to the app_data folder

View 4 Replies View Related

Connecting Visual Studio To Remote SQLExpress

Mar 3, 2007

Hello all,

I've been trying to find an answer to this to no avail. I'm not even sure if its possible. I like to do development at home in addition to work, like most of you do. Since it is my home computer, I like to play games, so I try to keep applications to a minimum. I would like to install sqlexpress on a virtual machine (which I have successfully done), and I can connect to it via Management Studio on my local machine (non-vm). Is there a way to set visual studio to use this connection as opposed to local host? I really do not want to load sqlexpress on my local machine and have yet another thing tying up system resources.

Your feedback is appreciated.

Barret

View 4 Replies View Related

Can't Start SQLEXPRESS So That I Can't Install Latest SQLEXPRESS Security Updates.

Mar 13, 2007

I can't start SQLEXPRESS.

The SQL ERRORLOG shows: Error is 3414, Severity 21, State 2 and says: "An error occurred during recovery, preventing the database 'model' (database ID 3) from restarting." Just prior to this, I get a warning: "did not see LP_CKPT_END".

Any thoughts why this might be and how I can fix this?

View 3 Replies View Related

Installing SqlExpress (Advanced Services) Will This Break Existing SqlExpress?

Sep 21, 2006

hiya,

I have sqlExpress and sqlServerManagementStudio on my XP pro box.

Will the installation of sqlExpress (Advanced Services) cause any problems?IS thereanything that I shold be aware of in advance?

many thanks,

yogi

View 3 Replies View Related

How To Install Windows Application(C#) With SQLExpress In A System Which Is Having SQLExpress Already?

Jan 19, 2007

Hi All,

I have created an installation application which will install the application with SQL Express and .NET Framework 2.0.

If i install this application in a Fresh system(i.e which is not having SQL Express), it is installing the application with new database instance successfully.

But if i try to install the same in a system which is already having SQL Express, throwing "Object reference exception" because it is not able to create the new database instance.

Can anybody help me out .

Regards,

Doppalapudi.

View 2 Replies View Related

ASP Classic And SQL 2005?

May 14, 2007

I want to know if it is possible to connect from classic ASP to a SQL 2005 database, and if so, can someone provide a sample connection string, I'm not sure if it is my connection string or server config. Thanks, Ed.

View 5 Replies View Related

SQL Everywhere, Ntext &&amp; ADO Classic

Jun 24, 2006

Hello!

I'm trying to move from MSDE to SQL Everywhere in my project, which requires using of ADO classic and i have some problems storing ntext data in SQLEv database using parametrized command.

Could it be that the problem is because of ADO classic? Is it ok to use old ADO with SQLEv OLEDB provider and will compatibility with old ADO be maintained in SQLEv?

Below is JScript code illustrating the situation:
-------------------------------
var oConn = new ActiveXObject("ADODB.Connection");
oConn.Open(sConnStr);
var oCmd = new ActiveXObject("ADODB.Command");
oCmd.ActiveConnection = oConn;
var sText = "test text";
oConn.Execute("create table tblTest(sText ntext)");
oCmd.CommandText = "insert into tblTest(sText) values(?)";
oCmd.Parameters(0).Value = sText;
oCmd.Parameters(0).Size = sText.length;
oCmd.Execute();
-------------------------------
It gives me 'Microsoft SQL Server 2005 Everywhere Edition OLE DB Provider: The given type name was unrecognized. [,,,,,]'.

If i remove 'oCmd.Parameters(0).Size = sText.length;' error changes to 'Insufficient memory to complete the operation.'

The same code works ok for MSDE and SQLExpress.

OS:Windowx XP SP2
MDAC version: 2.8

Many thanks!

View 3 Replies View Related

Classic Paged Report

Oct 6, 2007

Is there a way, other than simply changing the format of the SRS report, to create an old fashond Paged style report - similar to the ones you can get from Crystal Reports?

View 6 Replies View Related

Sqlexpress Installer Doesn't Believe Sqlexpress Has Been Uninstalled

Mar 21, 2006

Because of numerous problems trying to get sqlexpress working, I uninstalled it with the intention of reinstalling (via Add or Remove Programs). However, now when I try to reinstall it, I get a message that the I am not making a changes so it won't let me install it.

I do have sql server 2005 developer's edition installed; is that the reason? and does that mean I cannot have both installed on the same machine?

View 1 Replies View Related

How Can I Filter A Date Range In Classic ASP?

Feb 21, 2008

I have a Classic ASP page that provides me a view on Orders posted by customer for a selected month and year from a SQL Server 2000 database. This ASP page has a Stored Procedure that returns the orders posted by month and year. However, my needs are to be able to display the view by month, day and year to month, day and year, For example January 15, 2008 to February 14, 2008.

The current Classic ASP page has a dropdown to select the month and year from this dropdown only displays months and years for the months and years the customer had posted orders.

What I’d like to know is how to add to the classic asp page the means to input a date range on the fly that would return the report by month, day, year to month, day, year.

View 4 Replies View Related

Classic Datespan Membership Query.. Help?

Apr 26, 2008

Classic problem..


Say I have two simple tables (one with members the other with status
changes):


CREATE TABLE [dbo].[member](
[memkey] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[mname] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[state] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[dob] [datetime] NULL,
[effective] [datetime] NULL
) ON [PRIMARY]


CREATE TABLE [dbo].[memberstatuschange](
[memkey] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[transtype] [varchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL,
[date] [datetime] NOT NULL
) ON [PRIMARY]


sorry missing referential for simple example.


select m.memkey,m.effective,s.transtype, s.date from member m left
join memberstatuschange s
on m.memkey = s.memkey


produces:


001 2006-11-01 00:00:00.000 1 2007-12-01 00:00:00.000
001 2006-11-01 00:00:00.000 2 2007-02-02 00:00:00.000
001 2006-11-01 00:00:00.000 1 2007-02-05 00:00:00.000
002 2006-11-02 00:00:00.000 1 2007-06-01 00:00:00.000
003 2006-11-03 00:00:00.000 1 2007-07-01 00:00:00.000
003 2006-11-03 00:00:00.000 2 2007-08-02 00:00:00.000
004 2006-01-01 00:00:00.000 NULL NULL
005 2007-01-01 00:00:00.000 NULL NULL
006 2007-02-05 00:00:00.000 NULL NULL


transtype 1 = stop, 2 = restart.





effective date marks the start the original start of membership. So
in the case of memkey 001 he started on 2006-11-01, stopped on
2007-12-01, restarted on 2007-02-02 and stopped again on 2/5/2007.


memkeys 004,005 and 006 don't have NO status changes.





presuming that we should never have a status code of restart without a
stop but that the data may have violations of that.





How can I query my tables to return every date of ACTIVE participation
during two dates?





So for example if I say give participations criterias of 11/7/2006
and 2/7/2007, it should pull two records for memkey 001 as follows





memkey, days, start, stop
001, 6, 11/1/2006, 11/7/2006
001, 2, 2/5/2007, 2/7/2007



Thank you for any help or information!!.

View 1 Replies View Related

Accessing 64-bit MS SQL Server 2005 From Classic ASP

Aug 20, 2006

I'm considering shifting my database server to 64-bit MS SQL Server 2005 for improved scalability and performance. I'm concerned, however, that my classic ASP website (which sits on a separate server) may have problems communicating via ADO/OLEDB because of communication problems between 32-bit IIS on the web server and 64-bit MS SQL Server on the database server.

My current set up (which works fine) is:

Web Server: Windows Server 2003, Standard Edition, SP1 - running IIS with a set of ASP websites
Database Server: Windows 2000 SP4, running MS SQL Server 2000

Connection String:

MyConnection="Provider=SQLOLEDB;Network Library=DBMSSOCN;SERVER=192.168.0.1;INITIAL CATALOG=MyDatabase;UID=MyUserID;PWD=MyPassword"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open MyConnection

My core question is:

If I change my database server to new machine with 64-bit Windows Server 2003 running 64-bit MS SQL Server 2005, will my (32-bit) web server be able to connect from ASP as it does now?

Thanks for your help!
Jed

View 2 Replies View Related

From Asp Classic && Asp.net To Access Database Changing To Sql Server

Dec 17, 2006

Hello, We are re-writing our site in asp.net using sql server.  Most of the site uses asp classic and it was to an access database.  During the conversion we have everything working correct to SQL Server except for the asp.net connection string.  There is an important part of the application using asp.net which works fine with our connection string to the access database.  To recap our problem is the connection string from asp.net to sql server. This code works fine for the asp.net to access in the web.cnfg file     </microsoft.web>     <connectionStrings>         <add name="SalesConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:inetpubvhosts hemarketingvp.comsubdomainsvphttpdocsfpdbsalesMain.mdb" providerName="System.Data.OleDb"/>         <add name="ODBCSalesConnectionString" connectionString="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=E:inetpubvhosts hemarketingvp.comsubdomainsvphttpdocsfpdbsalesMain.mdb"/>         <add name="RawConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:inetpubvhosts hemarketingvp.comsubdomainsvphttpdocsfpdbsalesMain.mdb" providerName="System.Data.OleDb"/>         <add name="ConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|inventoryStatus.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient"/>     </connectionStrings>     <system.web> The code in the global.asa which works fine for classic asp to sql server also works fine and is as follows     '--Project Data Connection         Application("sales_ConnectionString") = "Driver={SQL Native Client};Server=DMSERVER01;Database=SQLsalesMain;UID=nTrack;PWD=nTrack2k3"         Application("sales_ConnectionTimeout") = 15         Application("sales_CommandTimeout") = 30         Application("sales_CursorLocation") = 3         Application("sales_RuntimeUserName") = ""         Application("sales_RuntimePassword") = "" Our programmer who set this up is out for a couple of weeks and I would appreciate any help in the correct connection string from asp.net to the sql server database in the web.cnfg file Thanks

View 5 Replies View Related

Limitation On Conn.Execute In Classic .ASP && ADO With SQL Server

Aug 13, 2004

Hello,

I have a project (using classic ASP & SQL Server) which adds one execute sql statement at a time to a temporary array, and then I join that array with a chr(30) (record separator), to a string variable called strSQL. I then run the following line of code:

conn.execute(strSQL)

I was wondering if there was any limitation to how large the strSQL variable can be? Reason I ask is because thru log writes I can see all of my sql execute lines exist in the variable strSQL prior to running the "conn.execute(strSQL)" command; however, not all of the lines run at the time of execution. Remember, this bug only is occuring whenever I have say over 600 sql lines to execute.

My understanding is that there was no limitation on the size of the string strSQL; however, in the interest of getting the bug fixed quick enough, I decided to just run a loop for each sql statment and run "conn.execute(strSQL)" every 50 times. This, in turn, has solved the problem and I do save all of my data; however, my original bug still exists.

Does anyone know why I have to split the sql commands and execute.com every 50 times instead of just being able to do it once ?

Please let me know. Thanks in advance.

View 8 Replies View Related

Classic ASP Errors Out Only In Production Environment With EOF Error

Oct 1, 2007


Microsoft VBScript runtime error '800a01fb'

An exception occurred: 'EOF'

Used the same connection string and DSN (i.e pointing to the same database/server) in both environments. ASP works in Test Environment. Fails in Production Environment.

Test and Production have same versions of software.

Environment Details:

OS: Windows 2003 SP2
MDAC: 2.8
Database: HP Neoview

Any help appreciated.

Thanks,

Venkata.

View 1 Replies View Related

Connection String For Classic ASP Global.asa To SQL Server 2005

Dec 1, 2005

I migrated my SQL Server 7 database to the new SQL Server 2005 that I installed on my PC.  I have classic ASP programs on my PC that used to access the SQL Server 7 database.  However, global.asa and these ASP programs can no longer connect to the new SS 2005 database.

View 9 Replies View Related

Classic Sales Summary With Royality Logic Has Me Stumped.

Nov 1, 2007

Hello everyone. I'm stuck with what must be a common sql challenge.



I've got this single table that looks like this:



Store, Original Store, Product, Sale type, Method, Amount



There will be two product types (prodA and prodB)


There will be two Sale Types (New and Recharge)


There will be two Method (Cash and Credit)





The tricky part is I also need to report sales activity when a store
was the Original Store for a customer Recharge at another Store.


The report needs to look like this:


Store , Product, Cash New Total, Cash Recharge Total, Credit New
Total, Credit Recharge Total, Outside Recharge Total

Grouping/Totally on Store/Product.



In the above "Outside Recharges" means the Store was the Original store
and another store performed a recharge on it's customer.




Thanks for any help or information

View 3 Replies View Related

Convert A SQLExpress File Based DB Project To SQLExpress Server DB Project

Jul 1, 2006

Hi All,I've been struggling with this for hours...Could someone please advise me on how to convert my current File based SQL Server Express website to a Server based SQL Express one.Particularly interested in what I need to do in the SQL Express management tool, changes I need to make the projecvt itself and changes needed to get IIS to understand things have been changed.Thanks,Martin.

View 1 Replies View Related

Migrating SqlServer2000-&&>2005 And Classic ADO: Problem With AddNew To Recordset, Related To AdFldUnknownUpdatable Attribute?

Mar 26, 2006

The application is running ADO (MDAC) version 2.81.1117.0.

The application gets an recordset created by SQLServer by an select statement. In this case the recordset is empty.

The application adds a record to the recordset by AddNew(). Works fine. But when assigning the first field (smalldatetime in database) I get ADO error -2147217887.

I have inspected the recordset and I found a difference between the working one from SQLServer2000 and the new one from SQLServer2005: The Attributes item for the fields in the recordset has the flag adFldUnknownUpdatable set in the working SQL2000 version but is not set from SQL2005.

The database on SQL2005 is copied from the SQL2000 system and attatched to the SQL2005 system. I Have checket that the compability flag for the database on the SQL2005 system is set to SQL2000 compability.

Nils Nordenbrink
Winkonsult AB
Sweden









View 4 Replies View Related

SQLExpress?

Aug 6, 2006

Hi
I'm pretty new to all of this. I downloded a starter kit and am a bit confised as to SQLExpress. I have SQL Server already installed and just wondering what the option are.
I am currently using Visual Web Developer Express Edition and in the config file data source is SQLExpress and can't go any further. I don't want to mess with my current setup so just want to get some sugestions first.
Anyway hope this makes sense.
Thanks
GP 

View 6 Replies View Related

Help With SqlExpress PLZ

Apr 2, 2007

I have just created a website with membership just using the standard SqlExpress auto generated file
Everything works fine until I upload it to webspace :(
I get the following Error
An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I don't have SQL Server 2005 :(

View 3 Replies View Related

Just Asking About SqlExpress And Ado.net

Apr 3, 2007

if my SQl server/COnnection is "SQL EXPRESS"..Im using an Import name "Import System.SqlClient" on every web form that i have...
as well as other SQl command name like "SQLConnection,SQLCommand etc..."is this the correct that im using all sqlcommand in my webform???
well sorry for this im just new..and one more thing..can i include Ado.net on it if my connection is "SQLEXPRESS" just i said?
Thanks for the answer....

View 1 Replies View Related

/SQLEXPRESS

Jun 20, 2008

Hi

I am new to this forum .
I am running through few problems for sqlserver account settings .

I) My registery key entry for MSSQLserver just has a client folder .
2) My sql server configuration manager just has
sqlserver 2005 services , native client configuration and 2005 network configuration.


I can't see any server name or databases under it.


3)I normally work on EMS lite so I can see my ./SQLEXPRESS as server and databases under it and i can create logins etc ..I assigned db_owner role to one of my recent created database.
but when I try to connect it says :

The user is not associated with sqlserver connection.

5) i have sqlserver express service running, vss and sql server browser running.


I googled and searched for the solution and it says the authentication mode should be turned to mix mode form win authentication.

But from where. Have i missed some installation .I am able to connect to my other database from EMS.





Please help me out.
Thanks in advance
SJ

View 1 Replies View Related

SQLExpress

May 25, 2007

I am trying to write an application for a MSSQL database, using SQL Express,and Visual Studio (Express edition)I tried to connect to an existing database (named testing) but to no avail.Visual Studio claims the database does not exist.Any ideas?TIA--Q: What is the difference between a mathematician and a philosopher?A: The mathematician only needs paper, pencil, and a trash bin for hiswork - the philosopher can do without the trash bin...

View 3 Replies View Related

SP2 On SQLEXPRESS

May 27, 2007

Installation of SP2 in step "Feature Selection" shows SQLEXPRESS unchecked and can''t be edited/checked.
I tried it many times on different servers with different OSes, etc

Does it mean that SP2 for Expres Edition should be downloaded and applieв separately?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved