Trouble connecting the cassandra database via remote access through JAVA |
I could ping the machine. But I could not access the machine using telnet
in windows. The servers is linux machine. Do you have any idea ?
Your firewall is blocking off the telnet port and probably the rest of the
ports cassandra needs. You need to add an exception telling the firewall to
open port 9160 (the client port). 9160 is the only port you really need to
have open unless you want remote jmx management etc.
To add an exception to your linux firewall:
iptables -I INPUT -p tcp --dport 9160 --syn -j ACCEPT
And if you want to save the state:
service iptables save
|
adding values within an recordset where the userid is the same php |
I dont know if i understood correctly but it seems that you would do
something like this:
$sum = array();
foreach ($recordset as $user) {
if(!isset($sum[$user->UserId])) { $sum[$user->UserId] = 0; }
$sum[$user->UserId] += $user->Score;
if($sum[$user->UserId] > 1) { continue; }
echo 'Event Code' . $user->code . '<br />';
echo 'Date' . $user->date. '<br />';
echo 'UserId' . $user->UserId. '<br />';
echo 'Fullname' . $user->Fullname. '<br />';
echo 'Score' . $user->Score. '<br />';
}
|
Exporting a recordset from Access 2007 to spreadsheet |
You're getting the error because ltr is a RecordSet and the function
expects a string.
Secondly acSpreadsheetTypeExcel3 is very old type of excel file. I
personally you should use at least acSpreadsheetTypeExcel9. This will take
care of your second error.
I believe this should work
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, ltr.Name,
"C:Testdb"
This is assuming ltr contains table names. If ltr.Name returns a query
then this probably won't work.
|
how to access DB retrieved data out of Recordset in javascript |
based on comment:
var StatusCode_arr_db;
while (!rs_dub.EOF ) {
StatusCode_arr_db = rs_dub("statusCode");
alert("1-->"+StatusCode_arr_db);
rs_dub.MoveNext();
}
alert("2-->"+StatusCode_arr_db);
IF you still see the variable as UNDEFINED then do what I say below,
BECAUSE I was correct with my ORIGINAL answer.
try
rs_dub["statusCode"];
or
rs_dub.Fields("statusCode").value;
I believe you were looking at a jscript example (which is MS javascript,
not the same.)
|
Need to fetch returned value from sql procedure in access recordset |
It sounds like your stored procedure actually returns only one value, which
will either be 0 or 1. This is often referred to as a scalar value (a
single value instead of a set or collection of values).
It also looks like you need to pass parameters to your stored procedure.
This is often referred to as a parameterized query. As you probably well
know, it's possible to write stored procedures that do not not use
parameters.
Set con = New ADODB.connection
Set rs = New ADODB.Recordset
rs.CursorType = adOpenForwardOnly
rs.LockType = adLockReadOnly
con.Open "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" '// Connection string.
Dim cmd as New ADODb.Command
cmd.CommandTimeout = 5
cmd.ActiveConnection = con
cmd.CommandText = "SQL GOES HERE"
cmd.CommandType = acCmdStoredProc
Dim param
Set param = cm
|
Ms Access 2003 VBA. Random order of table recordset? |
It's not random, it just looks that way. If you run it multiple times,
you'll see that it comes out in the same order.
If you want to select the order it comes out in, then use the ORDER BY
clause in your SQL. So, for you, it would be:
SELECT * FROM tblA ORDER BY {fieldname}
|
SQL Server Passthrough query stored into an Access VBA recordset |
You need to use a QueryDef object to create a Pass-Through query, then open
the Recordset via the .OpenRecordset method of the QueryDef. The following
code works for me:
Dim qdf As DAO.QueryDef, rst As DAO.Recordset
Set qdf = CurrentDb.CreateQueryDef("")
qdf.Connect = "ODBC;Driver=SQL
Server;Server=.SQLEXPRESS;Trusted_Connection=Yes;"
qdf.SQL = "SELECT GetDate() AS qryTest"
qdf.ReturnsRecords = True
Set rst = qdf.OpenRecordset
Debug.Print rst!qryTest
rst.Close
Set rst = Nothing
Set qdf = Nothing
|
Updating Database from csv using ado and vbscript without recordset loop? |
Use "INSERT/SELECT INTO IN 'External Database'". For your specific task
(text -> mdb,
your query) the statements would look like
Create new table:
SELECT T1.PERSON AS PERSON, T2.STATUS AS STATUS INTO [tblPeople] IN
"P:athtoyour.mdb.mdb" FROM [People#csv] T1 INNER JOIN [Company#csv] T2 ON
T1.COMPANY = T2.COMPANY
Append to existing table:
INSERT INTO [tblPeople] IN "P:athtoyour.mdb.mdb" SELECT T1.PERSON AS
PERSON, T2.STATUS AS STATUS FROM [People#csv] T1 INNER JOIN [Company#csv]
T2 ON T1.COMPANY = T2.COMPANY
|
DoCMD.OpenForm in Access - Opening a Form with limited recordset using WHERE |
You could try something like this as your main RecordSource SQL...
SELECT M.*
FROM Metrics AS M,tbl_User_Info AS U
WHERE U.User_Name=CurrentUser()
AND M.G_Var LIKE IIF(U.G_Var_Access=TRUE,'*','NO')
|
ASP (Classic) RecordSet value 'disappears' after first access, when MySQL TEXT data value |
Mark, I'm taking a long shot here. For what I know of Classical ASP (which
consists in years of swearing and loving), a NULL answer from the MySQL
database results in... nothing, actually. Unless you define the recordset
result as a string, it won't be comparable with a "". So, either you do
this:
var recordsetVal = oRs("textthing")&""
... or you could simply do this:
if oRs("textthing")&"" <> "" then
Also, instead of while ... wend, use a do while...loop lace. It might work.
Again, this is a long shot. many factors could be involved in this
question, but MySQL Driver and ODBC compatibility issue is only one of them
and, fortunately, the least probable. Keep us posted.
|
Populate field in ms access form from field in ado recordset record of the same name |
This is because you are not binding to the recordset. It would be better
if you stored your query and attached it to the form as the recordsource so
that way it will bind it to the form. Then you set the record source of
each field in design mode and no code is needed and it will be updateable
depending on your permission to the SQL Server.
|
lookup recordset value in another recordset |
I use a query with 1 parameter (the teamname)
ala: qry = "select score from table2 where teamname = ?"
rs1 = recordset1
do until .eof
qry1.parameter(0).value = rs1.team
set rs2 = qry1.execute
debug pring rs2.fields("Score")
rs2.close
rs1.movenext
end do
rs1.close
|
Waf, trouble adding manual dependencies |
It depends on how you want the target to be produced from the dependencies.
In the simplest case, you just use a build-rule with sources and a target:
def build(bld):
bld(
rule = 'cat ${SRC[0].abspath()} > ${TGT}',
source = ['hello.txt', 'there.txt'],
target = 'out.txt'
)
As you can see, out.txt will be produced by cat:ing hello.txt to it and
both hello.txt and there.txt will be seen as the targets dependencies. Here
I have hardcoded the dependencies in the wscript, but you would of course
call your program that generates the dependencies list as use that.
|
Trouble with adding chars to char*[] |
You could use:
char *spots[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
char *player1 = "X";
char *player2 = "O";
and then assign:
spots[i] = player1;
The types are consistent: spots is an array of char *, and assigning a char
* string to one entry in the array makes sense — and it is a pointer to a
null-terminated string that is assigned, the same as the other values in
spots.
You might want to consider:
char *player[] = { "?", "X", "O" };
Then you can use:
spots[i] = player[j];
The "?" allows you to use the encodings 1 and 2 for the players, of course.
With your code, you are assigning the address of a single character, not a
string, to the spot, and the printing code then reads until it finds a
null, leading to confusion.
|
Trouble adding checkboxes to HTML div using JS |
you are using the submit type input.
when you click on submit button page reload will occur and you cant see the
result of your javascript code
use a button instead
<input type="button" value="Add New Task" onClick="addTask()" id =
"taskAdder">
|
Trouble Adding a new field to a Model |
The problem is because you are passing IEnumerable model.
In this case you should enumerate through all you model items and pass them
into HtmlHelper methods.
And in this case I recommend you to pass List in your view like this:
@model List<FTv2.Models.UserProfile>
@using (Html.BeginForm()) {
for (int i = 0; i < Model.Count; i++)
{
<fieldset>
<legend>Edit</legend>
<div class="editor-label">
@Html.LabelFor(model => model[i].UserInput)
</div>
<div class="editor-field">
@Html.EditorFor(model => model[i].UserInput)
@Html.ValidationMessageFor(model => model[i].UserInput)
</div>
<p>
<input type="submit" value="Save" /&
|
Trouble when adding actionListener() to a JPanel |
JPanel doesn't have the capabilities to raise ActionEvents, thus it does
not have the method addActionListener.
Instead, you probably want to use a MouseListener instead
Check out How to write mouse listeners for more details...
|
Having trouble adding jquery to charisma |
I meet the same problem as you do. My solution is like this:
find the line "
$("input:checkbox,input:radio,
input:file").not('[data-no-uniform="true"],#uniform-is-ajax').uniform();"
then,remove the input:checkbox, then the checkbox in your project will not
display in the charisma way.Now you can use
$(this).prop("checked","checked"); to make the checkbox change.
|
Trouble with adding to HashMap using arguments |
public void addServer(String x, int y, int z){
ServerDetails details new ServerDetails(y,z);
serverList.put(x, details);
}
Are you perhaps forgetting an equals sign in the second line?
|
Trouble adding double the divs i already have |
Use setInterval rather than setTimeout. setInterval is used for events that
happen repeatedly based on the time you set, while setTimeout happens once.
jsfiddle
|
Reading data from file and adding it to database without adding the same values |
if (!isPatent(connection, preparedstatement, name))
addpatient(connection, preparedstatement, name, age, height, weight);
public static boolean isPatient(Connection connection,
PreparedStatement preparedstatement, String name)
throws SQLException {
boolean exists = false;
preparedstatement = connection
.prepareStatement("select * from allpatients where name =
?");
preparedstatement.setString(1, name);
ResultSet rs = preparedstatement.executeQuery();
if (rs.next()) {
exists = true;
}
rs.close();
return exists;
}
|
jQuery Adding and Removing Rows Trouble |
Alright, I think I found your problem. You are trying to call
$(table).querySelectorAll('tr'). .querySelectorAll is a javascript function
that you are using with a JQuery selector. This is where your removeRow()
function bombs. Try commenting that line out. Then, you will need to find a
new way to select the last row, which can easily be done with this:
$(table).find('tr:last').remove();
Final form:
function removeRow(){
//var items = $(table).querySelectorAll('tr');
if (rowCount > 1) {
//$(table).remove(items[rowCount - 1]);
$(table).find('tr:last').remove();
rowCount -= 1;
}
else
{
alert('CANNOT DELETE LAST ROW');
}
}
If you want this to work in IE8 and older, you can use this JQuery since
you have the number of rows:
$(ta
|
Trouble with adding default subfolder with htacess |
Try adding a slash after the ^:
RewriteCond %{HTTP_HOST} (.*)example.com$
RewriteCond %{REQUEST_URI} !^/(pl|no|en) [NC]
RewriteRule (.*) http://www.example.com/en/ [R=301,L]
The REQUEST_URI usually begins with a /
|
Having trouble adding a JComboBox to JXTable Cell |
I have solved the problem
I mistakenly disabled cell editing. All I did was to remove the code below:
@Override
public boolean isCellEditable(int rowIndex, int colIndex) {
return false; //Disallow the editing of any cell
|
Trouble adding horizontal scroll on dynamic table |
Change
$('#' + tableName + 'Table').css('overflow-x', 'scroll');
To
$('#' + tableName + 'Table').parent().css('overflow-x', 'scroll');
The parent element is the one that needs the overflow-x property.
Also you don't need javascript for this functionality. You can just set
overflow-x: auto; to the parent element, and it will add a scrollbar
automatically if its contents are too wide.
|
Trouble adding user defined function in Doctrine 2 |
It turns out that after modifying correctly my bootstrap.php file, I was
still unable to make the function work. After some fiddling, I found out
that while my query still doesn't work, the function do work using this
form :
$results = $s->select("GroupConcat(t.name) As
Name")->from("Type","t")->getQuery()->getResult();
So, after all, my problem resides in the DQL syntax using GroupConcat.
|
PHP - Trouble adding multiple drop down menu options to MySQL |
As Bart said mysql_real_escape_string works with strings, not with arrays.
The reason your $_POST['game'] is an array is because you have it named
game[]. You can try with one value if you change the name to game.
Although we want the code to work with multiple choices. You can change the
PHP code like this:
<?php
if(isset($_POST['submit']))
{
$query=mysql_connect('localhost','root','');
mysql_select_db("freeze",$query);
$choice = array();
foreach($_POST['game'] as $game) {
$choice[]=mysql_real_escape_string($game);
}
$choice1=implode(',',$choice);
mysql_query("insert into tb values('','$choice1')");
}
?>
By the way, can you tell us what is your database structure? It seems you
are making a big mistake with saving all the values the user picked
|
I'm having trouble adding a shapefile to my ggmap due to differing geographic units |
Here You have an answer:
library(ggmap)
library(maptools)
shapefile <- readShapeSpatial('MunicipalBoundaries_polys.shp',
proj4string = CRS("+proj=lcc +lat_1=34.33333333333334
+lat_2=36.16666666666666 +lat_0=33.75 +lon_0=-79 +x_0=609601.2199999997
+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"))
shp <- spTransform(shapefile, CRS("+proj=longlat +datum=WGS84"))
data <- fortify(shp)
nc <- get_map("North Carolina", zoom = 6, maptype = 'terrain')
ncmap <- ggmap(nc, extent = "device")
ncmap +
geom_polygon(aes(x = long, y = lat, group = group), data = data,
colour = 'grey', fill = 'black', alpha = .4, size = .1)
The coordinates needs to be transform to longlat projection and it's
working.
|
Trouble with query in Microsoft Access 2007 |
I examined this query in Access 2007 with the sample data from Live and
certified included below.
SELECT DISTINCT Live.*
FROM
Live
LEFT OUTER JOIN certified
ON Live.macAddress = certified.macAddress
WHERE certified.macAddress IS NULL;
The query gives me this result set, which is what I think you're asking
for.
macAddress some_text
00-0C-29-80-BA-A3 bar
Table Live:
macAddress some_text
00-0C-29-80-BA-A3 bar
38-60-77-77-D0-D4 foo
Table certified:
macAddress
38-60-77-77-D0-D4
Assuming you have verified there are Live.macAddress values which are not
present in certified, but those are not returned by the same query with
your data, perhaps you have macAddress indexed and the index is corrupted.
In that situation, you could have Live.macAddress values whi
|
Trouble restoring database using T-sql |
No, the second code is not identical. After
move
it says
'Clinical_Data'
not
'Clinical_Data_Extension'
.That is crucial. It is the Logical Name of the data container inside the
backup.
USE master
GO
RESTORE FILELISTONLY
FROM disk='c:Clinical_Data_Extension_full.bak'
gives You the precise Logical Names. Logical Names and Database Names do
not need to be of the same convention. The Logical Name for the data
container in 'Clinical_Data_Extension_full.bak' could be 'Clinical_Data' as
in the other backup. The error states that Your specified Logical Name is
not present in 'c:Clinical_Data_Extension_full.bak'.
The same mixup can happen with the log container.
|
Link Access Database with Mysql Server and Use Access as Frontend [Table Issue] |
You just need to rename your Linked MySQL table (rename the link in Access
only) so that it matches perfectly the name you were using for that same
table before in Access. This way you won't have to change your forms,
queries, reports.
There is no magic that happens in Access between local tables and linked
tables. It's still up to you to move your data, make sure the MySQL table
is designed the way you want it, maintain the links, delete old Access
tables, etc.
|
Trouble calling SQL Server Stored proc from Access 2007 |
The code looks right, although you could try using bind parameters instead
of a single SQL string. For something quick and dirty it doesn't make any
difference, but this removes the possibility of SQL injection
Dim lConnection as new ADODB.Connection
Dim lCommand as new ADODB.Command
Dim lParameter as ADODB.Parameter
Dim lRecordset as ADODB.Recordset
lConnection.ConnectionString = "Provider=SQLOLEDB;Server=" &
CurrentServerName() & ";Initial Catalog=" & CurrentDBName() &
";Integrated Security=SSPI;"
lConnection.Open
lCommand.ActiveConnection = lConnection
lCommand.CommandText = "dbo.cpas_DeleteProjects"
lCommand.CommandType = adCmdStoredProc
set lParameter = lCommand.CreateParameter(, adVarWChar, adParamInput, 200,
ProjectIDs) 'replace 200 with parameter length, different
|
How can I decrypt or gain access to a protected Access database? |
The chances are pretty good that the .mdw file is the workgroup file for
that .mdb database. (The .mdw file does not need to have the same name as
the .mdb file because several different .mdb files can all share the same
workgroup security settings.)
To access an .mdb file that has user-level (workgroup) security enabled you
need to open it using a shortcut (or command-line invocation) of the form
"C:Program FilesMicrosoft OfficeOffice14MSACCESS.EXE"
"C:UsersPubliculsulsTest.mdb" /WRKGRP "C:UsersPubliculsSecurity.mdw"
For a more detailed write-up, take a look here.
|
Limit access to a database to a few users. (MS Access 2007) |
If you hit file, then hit options, and then select current database, you
can force a specific form to pop up whenever you open the access database.
In addition, you can take away the user's ability to go through the entire
database's content. you can also take away the navigation bar and menus and
such. I have been doing this for a while, so here's some advice. Have a
main menu form that has a button for every form in the access file. When
the user opens the database, he or she should see that main menu form. From
there, they can click on the button that will lead them to the form that
will solve the needs they have.
Stackoverflow won't let me post a comment, so here is what I was going to
say. For those who you want to have access to it, you can have them hold
shift while opening the da
|
How can I open an Access database when it shows an "unrecognized database format" error? |
If you are using Windows Vista and up, you may have a system backup.
Right click the file and select Restore Previous Versions.
If this does not work, try Access Database Corruption Repair Guide
You could try creating a new empty MDB file and importing the objects from
the old one. It might work at least for some of the objects.
|
performance of database updates using DataAdapater vs. SQL command when working with VB.NET and Access database |
Is there significant impact in between these two methods?
That is a very general question, so the general answer is "It depends...".
The overhead of creating and filling a DataAdapter will cost you something,
but whether or not that is a significant cost will depend on factors
like...
how much data is in the table(s) you are updating
how much information you are pulling into the DataAdapter
whether the database file is on a local drive or a network share
...and (perhaps) many other factors. The only way for you to know if there
is a significant performance difference between the two approaches in your
particular circumstances would be for you to run some tests and compare the
results.
|
how to connect MS Access database with matlab (transfer data from GUI and save in database ) |
You need to run SQL queries on the database; you can do this with
database.fetch (and a few other friends).
The example query from the docs:
conn = database('dbtoolboxdemo','','');
setdbprefs('DataReturnFormat','cellarray')
results = fetch(conn, 'select productdescription from producttable')
% Not in the example in the docs: this syntax, which I prefer, is also
supported
results = conn.fetch('select productdescription from producttable');
Note that you will also need to know how to write SQL. For that, there are
plenty of resources online - you just have to search for them.
|
trouble regarding inserting values in database using android |
Steps for checking database using ddms and sqlite manager
First install the Sqlite Manager.
Open ddms in file explorer tab go to data inside data select data.
Navigate to the folder named as your project name inside that folder goto
database and
select your database file.
Pull that file and save to your computer.
Open the SqliteManager and open the same file in sqlite manager and then
check your table structure.
|
Trouble getting php data from database through javascript function |
You can't call a PHP function through JavaScript like this:
link.innerHTML = "<?php dynamic(); ?>";
You will need to make an AJAX call to run the PHP script and return the
result. I would recommend using jQuery and $.ajax, which makes this very
easy.
http://api.jquery.com/jQuery.ajax/
|
Trouble writing to database in C# WinForm Application |
It might be the speechmarks around the values you're putting into the
database. Try changing to apostrophes.
Anyway, I strongly recommend storing the final SQL in a string and printing
it to a log file or the screen and then copying that to your Access SQL
editor and trying to run it. Then you'll see if there's an error and what
it is.
|