I have been trying to browse a SQL Server database-based Crystal Reports version 8 with following Visual Basic code:
CrystalReport1.ReportFileName = "C:\Report1.rpt"
CrystalReport1.Destination = crptToWindow
CrystalReport1.DiscardSavedData = True
CrystalReport1.WindowState = crptMaximized
MsgBox "Ok!", vbInformation
CrystalReport1.Action = 1
I am using the Crystal Reports control. The database of the report is ODBC datasource connecting to SQL Server. Without DiscardSavedData this works, but it displays old data. With DiscardSavedData, I get the error message:
Error 20599 Cannot open SQL Server.
How do I solve this problem?
i have solved my issus by adding the connection string CrystalReport1.Connect, i'd like to share my solution for all.
CrystalReport1.ReportFileName = "C:\Report1.rpt"
CrystalReport1.Destination = crptToWindow
CrystalReport1.DiscardSavedData = True
CrystalReport1.Connect ="Data Source=Localhost;UID=sa;PWD=****;DSQ=Dat BdName;"
CrystalReport1.WindowState = crptMaximized
CrystalReport1.Action = 1
Related
I'm working VSTO and I have an issue.
I want to get a Version of Office but I can't
I want to get 2008
Please help me! Thanks
I'm using C#
You can get the file version information of the Office application.
// Retrieve the path e.g. from the InstallRoot Registry key
var fileVersionInfo = FileVersionInfo.GetVersionInfo(#"C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE");
var version = new Version(fileVersionInfo.FileVersion);
// or you can get the information from the running instance using the `Process` class
var process = Process.GetProcessesByName("winword").First();
string fileVersionInfo = process.MainModule.FileVersionInfo.FileVersion;
var version = Version(fileVersionInfo);
I established connection with my Neo4j graph database:
neo4jconn = neo4j(url,username,password);
checked that the connection is working:
neo4jconn.Message
ans =
[]
But when I try to query the database using Cypher:
query = 'MATCH(m:Nutrient) RETURN m';
results = executeCypher(neo4jconn, query)
I get the following error message:
Error using database.neo4j.Neo4jConnect/executeCypher
Cannot execute Cypher(R) query.
When I use the same query command in Neo4j browser I get the result which I need.
My problem was in the 'url' variable. When I start Neo4j it opens in the browser at: 'http://localhost:7474/browser/'. I created a new subdirectory /Neo4j/fiadb to store nodes/relationships of my database. And I used the following url for the Matlab 'neo4jconn = neo4j(url,username,password)' command:
url = 'http://localhost:7474/browser/fiadb'
This proved to be the right path:
neo4jconn.Message
ans =
[]
I have place moodle files: C:\xampp\htdocs\moodle, E:\moodledata and in mysql created database "moodle".I m getting this error message on the webpage when opening moodle
"Config table does not contain version, can not continue, sorry.
More information about this error
It is usually not possible to recover from errors triggered during installation, you may need to create a new database or use a different database prefix if you want to retry the installation."
Setting in config.php
<?php // Moodle configuration file
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'moodle';
$CFG->dbuser = 'root';
$CFG->dbpass = '';
$CFG->prefix = 'lms_';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbport' => '',
'dbsocket' => '',
);
$CFG->wwwroot = 'http://'.$_SERVER['HTTP_HOST'].'/moodle';
$CFG->dataroot = 'E:\\moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 0777;
require_once(dirname(__FILE__) . '/lib/setup.php');
// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!
It looks like it got interrupted during install and now the database is incomplete. You can try two things: insert the missing version number into the config table, for example by using phpMyAdmin, or delete the database, create a new one and try to install again.
To insert the version number:
open the file version.php to find the version number.
in your database manager, go to the table mdl_config
insert a new record with the values: name='version' and value='the version number you looked up in the version.php file'
this can happen if the install process is not perfect.
You haven't told us the version or anything about the 'local server'
so we can not see the specifics of your problem.
check the release notes for the version you are using and make sure 100% that your server meets the requirements.
I am using vb6 program to export a crystal report to excel sheet.After running the program the exported excel sheet is unreadable. getting the error "Unable to read file"
CrxRep.DiscardSavedData
CrxRep.ExportOptions.DestinationType = crEDTDiskFile
CrxRep.ExportOptions.FormatType = crEFTExcel97
'Input parameter set
CrxRep.ExportOptions.DiskFileName = DestName
CrxRep.ExportOptions.ExcelExportAllPages = True
CrxRep.EnableParameterPrompting = False
CrxRep.ExportOptions.ExcelUseWorksheetFunctions = True
CrxRep.ExportOptions.ExcelUseTabularFormat = True
CrxRep.ExportOptions.ExcelPageBreaks = True
CrxRep.ExportOptions.ExcelTabHasColumnHeadings = True
CrxRep.Export False
However this problem occurs only on production server.When I tried to export in dev server it works fine.
From where are you trying to read the file ?
If you are logged onto the server and can't read it, that suggests that Excel or perhaps ADO is not installed on the server, but you can answer that by looking at the icon. If windows recognizes the file type and shows you the Excel icon, then Excel is installed there.
If Excel is installed there, then copy the file to your desktop, or to the dev server, and try to open it there. If it opens there...the problem is likely a missing component ( perhaps ADO ) on the prod server.
I have a problem with connection from VisualBasic (Excel) to postgresql.
I define my connection like that:
Set ObjMyConn = New ADODB.Connection
ObjMyConn.ConnectionString = "Driver={PostgreSQL Unicode};Server=ip;Port=port;Database=db_name;Uid=user;Pwd=pass;"
ObjMyConn.Open
When I want to load 443532 rows into Excel with
Set objMyCmd = New ADODB.Command
Set objMyCmd.ActiveConnection = ObjMyConn
objMyCmd.CommandText = "select * from table"
objMyCmd.CommandType = adCmdText
objMyCmd.Execute
It keeps showing me run-time error Out of memory error while reading tuples.
I have already upgraded my ODBC driver to the latest version. I read here that I have to set Use declare/catch to true somewhere (odbc driver I guess).
Is it possible to set it in VB code?
I believe you can just add the UseDeclareFetch=1option to the connection string like this:
"Driver={PostgreSQL Unicode};Server=ip;Port=port;Database=db_name;Uid=user;Pwd=pass;UseDeclareFetch=1"
But, if that doesn't work, there's another method - if you have set up a ODBC system data source with the ODBC Database Connection Administrator you can modify the registry key directly (provided you have the sufficient permissions).
The key you want to change is located under HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\PostgreSQL35Wif you're using a System DSN and the following vba code will enable Use Declare/Fetch:
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\ODBC\ODBC.INI\PostgreSQL35W"
strValueName = "UseDeclareFetch"
strStringValues = "1"
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strStringValues