ASP VBScript Connection String to Access 2000 DB - ms-access

We have an old Access 2000 database that we need to pull data from and store it into a text file via a web interface that has to run every 20 minutes. I have spent hours and hours searching for a correct connection string without anything working.
I even used Dreamweaver's point-and-click solution and was able to get it to connect and pull data with a System DSN on my local machine, but it shows a 500 Internal Server Error when I upload it to the testing server (both the local and the testing server System DSNs have the same name). (For clarification to die-hard programmers, I am a developer and am using Dreamweaver because I have no idea what I'm doing with ASP.)
I created a System DSN on the testing server (win server 2008), but it doesn't seem to work. I don't know if it's something with the VB code I'm writing or an issue with the DSNs. Could I please get some help with this, my deadline for this is tomorrow morning! (If I don't meet the deadline, major systems in our business will not work!)
Dreamweaver Connection:
Dim MM_LocalDb_STRING
MM_LocalDb_STRING = "dsn=Db;"
Dim Students
Dim Students_cmd
Dim Students_numRows
Set Students_cmd = Server.CreateObject ("ADODB.Command")
Students_cmd.ActiveConnection = MM_LocalDb_STRING
Students_cmd.CommandText = "SELECT * FROM Students"
Students_cmd.Prepared = true
Students = Students_cmd.Execute
Students_numRows = 0
I have also seen various connection strings and have tried them with no success. Please help! (Thank you in advance.)

If you can, try accessing the page locally on the test server. I believe this should give you a more specific error than just the generic 500.
My thought, because this works on your dev machine, is that it's a permissions error. You should make sure that the IUSR and, I think, LOCAL SERVICE accounts have read/write permissions to the database file.

Related

read full database path on asp classic to new server

Currently we use a windows 2003 (IIS 6.0) server with SQL Server 2008 R2 that runs perfectly a asp classic code. We are migrating to windows 2016 server with the same version of SQL Server. In most of the code it was necessary to put the full database path. The original that works on the other server, e.g.:
SELECT * from File
when changing to
SELECT * from [TABLE].[dbo].[File]
the new server can execute and read correctly.
In the part that the code itself has the legible queries is easy to understand. I do not know the asp classic well and the original code has variables with the same table name so I do not know if the called code item is actually the table or the variable.
I think it's something from the environment to set up. Would it be possible to resolve this without having to change the whole code?
I try to understand the error from logfile from IIS.
Maybe someone have the same situation, I solve this change the DSN connection (ODBC)
Dim rs
Dim conexao
Set conexao = Server.CreateObject("ADODB.Connection")
conexao.Open "DSN=database","sa","password1234"
I change the last line to use Provider too like example:
conexao.Open "Provider=SQLNCLI10;Server=nameserver\nameinstance;Database=‌​namedatabase;UID=sa;‌​PWD=password1234;"

MS Access Linked SharePoint Online Lists Connection String

I have an MS Access app that has 2 linked lists from SharePoint Online. I iterate all tables on start up and Refresh the Links as I want to make sure the connection is good and also for if I want to point at a different SharePoint Online Instance, say for Dev or Test. This only works if I'm logged into SharePoint Online, so I want to change that so I don't get a prompt to log in. I've done this before with on premise SharePoint and the AD authentication is all you need, but SharePoint Online is not connected to AD and uses a completely different set of credentials.
My connections string looks like this if you view the List in Design from inside MS Access.
ACEWSS;HDR=NO;IMEX=2;ACCDB=YES;DATABASE=https://mycompany.sharepoint.com;LIST={AF7E4E8E-6E7D-4BEA-B856-F69BF58114A4};VIEW=; RetrieveIds=Yes;TABLE=spMyList;
Is it possible to add credentials to this connection string? I looked up on http://www.connectionstrings.com and they have example but nothing works. I tried User/Password and also uid/pwd but I still get that prompt.
The answer to this problem is to set the TableDef.Attributes Property to DB_ATTACHSAVEPWD just before the Connect and RefreshLink as shown below.
tblDef.Attributes = DB_ATTACHSAVEPWD
tblDef.Connect = strSQLAzureConnectionString
tblDef.RefreshLink

New LightSwitch Project

I have started a new Lightswitch project using a SQL database that was created with Lightswitch. When I publish and install the new Desktop project everything goes fine with no errors in publishing, installing or loading the new application. The first and only screen appears. I can click on different records and the data shows up and I can edit the data. However, if I use the list search function all of the fields get Red x'd.
The original application works the way it supposed to work.
I have tried with and without IIS: Published with (local) and (IIS) and get the same results with both methods.
The connecection string options for the new app are not the same as the original in that System Admin and Sytem user connecection strings are not offered so it is difficult to know if I replicating a working setup or not.
In Mananagement Studio I am awash in security, permissions, roles, and login selecitons. It seems clear that this is permission level problem but I have no idea on where to start trouble shooting.
see:
Diagnosing Problems in a Deployed 3-Tier LightSwitch Application
http://blogs.msdn.com/b/lightswitch/archive/2011/09/20/diagnosing-problems-in-a-deployed-lightswitch-application-eric-erhardt.aspx
How many string properties are in the table that you're displaying? Is there a large number of properties that don't need to be included in the search?
This forum post discusses the same issue as you're encountering: Search returns error "Unable to load data" with a Red X
Have you checked your connection string setup? I do have those issues back when I was using SQL Express on development and using SQL Server Enterprise as my target database server.

Local Load Testing: The load test results database could not be opened

I am creating some Load tests using VS2012. I can run the tests using a StorageType of "None", but when I change this to a StorageType of "Database" I get the dreaded error
The load test results database could not be opened. Check that the
load test results database specified by the connect string for your
test controller (or local machine) specifies a database that contains
the load test schema and that is currently available. For more
information, see the Visual Studio help topic 'About the Load Test
Results Store'. The connection error was: An error occurred while
attempting to create the load test results repository schema: To
create the database 'LoadTest2010' your user account must have the
either the SQL Server 'sysadmin' role or both the 'serveradmin' and
'dbcreator' roles
I have created a database on a non local copy of SQL called LoadTest. When I test the connection from the SQL Tracing Connect String dialog I get a success.
I have created a SQL user that has the Server Roles of dbcreator, public, serveradmin and sysadmin. The user has a User Mapping to the LoadTest2010 database that was created from the loadtestresultsrepository.sql in the VS2012 IDE directory. On the database the user has the Database role memberships db_accessadmin, db_datareader, db_datawriter, db_owner.
In the Owned Schemas i ticked on the db_datareader, db_datawriter, db_owner and db_securityadmin howver these have now gone to a blue square instead of a tick when displayed.
So what's going on? Is Visual studio trying to create the database or is something else the issue?
I am not using TestControllers or TestAgents I am simply using a local run.
The answer was simple. I was setting up the connection string in the "SQL Tracing Connect String" instead of clicking the little "Manage Test Controller" icon at the top of my load test window and setting up the connection string from there.
Now I'm off to remove some of those superfluous permissions I created on that SQL user :)
Edit:
The SQL Connection String is NOT stored in the loadtest files. The setting seems to be PC specific so I had to change it on the build server - in one loadtest file (address.loadtest) as shown, then all the other loadtests adopt the same connection string.
I am using Visual Studio 2013 and had this error as well, but for a different reason. It's not entirely clear when setting up a load test for the first time that it will attempt to save the results to a database by default. I didn't realize it was trying to save results to a database until I got the error on my first run attempt. Furthermore, in the load test wizard, there is no screen to configure the database settings or create the database schema for that matter.
I found this article on MSDN which helped me solve the problem.
How to: Create a Load Test Results Repository Using SQL
https://msdn.microsoft.com/en-us/library/ms182600%28v=vs.120%29.aspx?f=255&MSPPError=-2147217396
Basically, it explains that you first need to run a script to create the load test repository schema. Once this is in place on your SQL instance is (it could be anywhere you like), then you can point your load test to this database and save your results there.
For me after I had set database connections and all the test results was still not writing to the database.
I forgot to change my storage type in the properties section of the runsettings.
The property is called 'Storage Type'
Storage Type : change it from None to Database

Using Excel To Read From Access Without MS Access Installed On Computer

I have written code that joins two table in access, using criteria supplied from drop down lists in Excel and then returns the data to a specific location on the spreadsheet (titles already on the sheet).
This works fine on my box and others with MS Access on the machine, but the purpose of writing this was to give people (associates) that don't have MS Access on their machines (which is most of them) to be able to do simple queries to the database.
When we try to run this on a machine without MS Access, we are getting the error message
"Compile Error: Can't find project or library."
Since this works fine on any machine so far that has Access, but not the others I am wondering if this is not possible without the actual Access software. Any help or insight would be appreciated.
you need to use ADO and the "jet" provider. This will allow you to query an access database without having access installed
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
set objRecordset=Server.CreateObject("ADODB.recordset")
objRecordset.activeconnection = conn
objRecordset.source = "select * from table where field1 = 'asdf'"
objRecordset.open
'do you work here
objRecordset.close
conn.close