Let me lay out the background details first.
I'm using visual studio 2013 to write a vb.net windows forms application to load a crystal report (.rpt) file. The main report and sub report uses a SQL command from a Pervasive database (through an oledb connection) as shown in the picture below. For privacy, I've changed the database name to DBNAME.
I installed SAP Crystal Reports Runtime Redistributable 13.02 on the client computer. Obviously, I have the developer version on my computer.
Everything seems to work just fine when I run the build from my computer (the one used for developement), but when I try to run it on the client computer I get a window like the following:
So a few things to note here:
On the development computer, this prompt doesn't appear.
For some reason the database name shows up where the file server name should be
I never set a username or password, nor have I ever needed one to access this database through the control centre from any computer on
the network
no conceivable combinations of usernames and passwords work (including network credentials, windows credentials, and leaving it
blank)
I've tried forcing the credientials in the viewer form load event
CrystalReportViewer1.ReportSource = rpt
rpt.SetDatabaseLogon("", "", "FILESERVER", "DBNAME")
rpt.Subreports("Subreport2").SetDatabaseLogon("", "", "FILESERVER", "DBNAME")
rpt.Load()
but it doens't seem to make a difference. What am I missing?
Ok, I got it. Thanks to Bugs for pointing me in the right direction. The problem was with the connection type in the report. Changing the connection to ODBC (RDO) using 'right click > Database > set Datasource location' got rid of the credentials prompt, but instead caused a "Failed to open the connection" error. From there I looked for differences in the ODBC administrator from the pervasive control centre. I found that I had a system DSN that happened to have the same name as my database (which is why it confused me). Creating the DSN on the client computer resolved the connection problem.
Related
Every application I use to initiate an ODBC connection that I've created to my IBM Notes 9 DB results in getting an error during connect:
Driver's SQLAllocHandle on SQL_HANDLE_DBC failed
I have scoured the web trying to correct this and have not been able to find an answer that solves for this issue on my machine. I am able to open and access the Lotus Notes DB within the Notes 9 software. I am able to create the ODBC System DSN and I know that it's connecting to the server properly because all of the available .nsf files populate in the "Database:" dropdown menu when going through the new ODBC connection setup. I am able to see my username which gets populated from my Notes ID file. The issue occurs when I use something to initiate the ODBC connection. I have tried Excel, QlikView, AQT, Teradata SQL Assistant all with the same result. Once I choose the ODBC connection that I've created, and click on "Ok" in each application I've attempted this with, I am met with the same error above.
I used Event Viewer per a suggestion in an older post online and received the message below:
Could not load NSQLE32.EXE. This file must exist in the same directory NSQL32.DLL and NSQLV32.DLL is in. It is possible NSQLE32.EXE could not be loaded because NotesSQL couldn't locate a valid Notes/Domino installation (couldn't find NNOTES.DLL) -- this may be because user (MYUSERID) does not have the correct rights to the Notes/Domino directory. It could also be because NotesSQL can not find your Notes/Domino installation in the Registry. NotesSQL looks for the NNOTES.DLL file by looking in the path pointed to by the following Registry entries -- HKEY_LOCAL_MACHINE\Software\Lotus\Notes{version}\Path : HKEY_LOCAL_MACHINE\Software\Lotus\Domino{version}\Path. If neither of these registry entries exist or they point to an invalid version of Notes/Domino NotesSQL will not work. To resolve -- please re-install Notes/Domino.
Some notes (no pun intended) and things I've done:
Verified that the DLLs mentioned in Event Viewer do exist in the proper directories.
Run the Nsql_ALM.exe application to configure the NotesSQL driver.
Used the 32-bit ODBC Administrator because my Notes 9 is 32 bit, as well as the driver. The 64 bit driver would not even allow installation (attempted this after hitting this roadblock) but the 32 bit installed successfully.
Modified my System Environment Variable for Path to include the true location to notes.ini, which resides in:
C:\Users\MYUSERID\AppData\Local\Lotus\Notes\Data
Modified my System Environment Variable for Path to include the location to the NotesSQL driver, which resides in:
C:\NotesSQL
Modified my registry to ensure that the appropriate strings exist to reference the proper files:
HKEY_CURRENT_USER\Software\Lotus\Notes\NotesIniPath (to notes.ini)
HKEY_LOCAL_MACHINE\SOFTWARE\Lotus\Notes\9.0\Path (to notes application)
HKEY_LOCAL_MACHINE\SOFTWARE\Lotus\Notes\9.0\DataPath (to notes.ini)
HKEY_LOCAL_MACHINE\SOFTWARE\Lotus\Domino\9.0\Path (to notes application)
HKEY_LOCAL_MACHINE\SOFTWARE\Lotus\Domino\9.0\DataPath (to notes.ini)
Set the NSQLE32.exe application to run in compatibility mode with all other options.
Attempted with everything run as administrator.
Uninstalled both Notes and NotesSQL and reinstalled everything cleanly again.
Attempted a log via Tracing within ODBC Administrator and it will not create a log file when I am attempting the connection. It will populate, however, with all of the system ODBC connections when the calling application attempts a lookup of the existing connections to populate in the dropdown menu. If I start tracing after the dropdown menu has been populated, then attempted the ODBC connection, even multiple times and with multiple versions, a new log file is never created.
I'm not sure where to go from here. Has anybody had this issue and is there something else that I can do in order to fix it?
I was able to correct the issue based on information in the Event Logs (Windows - Application) indicating that the Notes.INI file could not be located. I first added the location of notes.ini to the user and system environment variables, however, the issue persisted. I then moved notes.ini to the c:\NotesSQL folder where database connectivity dll's such as NSQL32.dll are found. This corrected the issue.
The application calling notes is SAP BusinessObjects Edge (Enterprise - Crystal Reports) 4.2 SP07.
notes.ini can not be found - Windows application event log
I have Report Builder 3.0 installed on my local PC. I am creating a new report and adding an embedded data source to a SQL Server Analysis Services database.
When I build the connection string of the data source, choosing the server name and the database name, I click 'Test Connection' and receive a message saying "Test connection succeeded". So far, so good.
I close the connection properties with the OK button, and on the Data Source Properties window I click the 'Test Connection' button. This time I get an error saying "The connection either timed out or was lost".
If I ignore the error then I can successfully add a dataset to my report and add data from the dataset in to the report design, but when I try to run the report (on my local PC) I again get an error connecting to the data source.
My best guess is that the connection that succeeded is running under my credentials, whereas the connection that fails is running as some other credential and so needs to use Kerberos delegation to pass my credentials along, but that is only a guess and even if I am correct I am at a loss to understand how to fix the issue - I don't know what other credentials may be being used and I have already set SPN's for the Analysis Services service account.
So it turns out that it was a Kerberos issue as I suspected, and I was also correct that Report Builder was testing the connection using some process running under another authentication context.
It turns out that when setting up Report Builder (and I had forgotten it) that you specify a default SSRS Report Server (see screenshot). It must be that when testing data sources or running reports that it connects to that default Report Server and does the work from there - I was assuming that everything was running locally!
Once I figured that out it was just a case of finding a good guide on how to configure SSRS for Kerberos and everything started working. In my case the only bit that I hadn't already done was to add the <RSWindowsNegotiate/> setting to the AuthenticationTypes in the rsreportserver.config file
Using classic ASP on Windows 7pro or Windows 8.1pro, I connect to a Microsoft Access 2003 database with the connection string "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=D:\INetPub\KN2014\Databases".
This works fine until I call for user authentication with the code:
sAccount=Request.ServerVariables("LOGON_USER")'NT challenge
if sAccount="" then
Response.Status="401 Unauthorized"
Response.End
end if
The authentication is forced on a different page. If I do this in the same window and then return to the page which connects to the database a 80004005: Unspecified error occurs. Only resolution is to close the window and reopen it. If I manually open a second window (same sessionID!) I get the same problem in the second window. The first keeps working fine, even after a refresh.
I've tried to open that second window with program code, but then I get the error in the first window also.
Searching this site, I have done the trick granting read access on sysWOW64/inetsrv. Also: If I do a clean install for Windows 7, it works fine for a while than "Something happens" (maybe installing VS of Office) and the old problem occurs again. Tricks like using basic authentication, using Kerberos or changing the order of authentication protocols seem to have no effect.
I'm an "old school" developer. I hope someone can help me by providing the most simple classic ASP code to do authenticate using windows verification and read/write access to a Microsoft access db.
With Access you need to make sure that your database working in multi-user mode (available on 2010 and later) and you need to detect when user leave your page to close connection to Access upon exiting/closing your site/page.
That is a curse of Access since earliest versions of it.
Or make sure that you open database without locks. IN SQL server that could be achived by executing following upon opening your SQl statement:
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
But I am not sure if this even possible in Access, better option just to switch to SQL Express.
There is a long back story to this, but to summarize I am trying to create a SQL Server connection in my VB program to automatically run some queries and display results. I have been able to do this easily when the server is on my network in the past. Now my company is moving to a hosted server and I am running into issues.
I can successfully connect to the server using SSMS when I use the RUNAS command:
runas /netonly /user:[network domain]\[username] "C:\Program Files (x86)\Microsoft SQLServer\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"
But I can't figure out how to set the VB program SQL connection string in similar fashion.
I know I can use Integrated Security = SSPI to specify Windows Authentication, but I need to pass the username and password as well, along with the network/domain information.
When I try to do this I get a "Login Failed for User..." message or "The Login is from an untrusted domain and cannot be used with Windows authentication" with Integrated Security=SSPI.
There is something about Windows Impersonation but I haven't been able to get a grip on how it would work here.
If this is possible the changes need to be almost entirely on my end, as the hosting company is very ...picky... about making any changes to their environments or settings.
I appeal to the wisdom of the internet for answers!
Extra Facts:
SQL Server 2008, Windows 7, Microsoft Visual Studio 2013, Windows Form Program
There is a good knowledge base article about that for ASP.NET, but I think the code solution also works on other platforms:
Dim impersonationContext As System.Security.Principal.WindowsImpersonationContext
Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity
currentWindowsIdentity = CType(User.Identity, System.Security.Principal.WindowsIdentity)
impersonationContext = currentWindowsIdentity.Impersonate()
'Insert your code that runs under the security context of the authenticating user here.
impersonationContext.Undo()
Inside, you can run you connection with SSPI defined as you normally would.
My company had a very old one form module developed in VB and back end is Access and I was forced to remove that system and re install this application to new system
I had succeed in doing the same and Data entry etc is working fine the only issue is when I am trying to give the print a crystal report form is opening which gives the below message.
I installed Microsoft Access and the db file is also in the directory folder.Can any one sugest any solution please