Can you post your form html? Thanks.
There is probably just a disconnect between the form item names and your form processor code.
Can you post your form html? Thanks.
There is probably just a disconnect between the form item names and your form processor code.
That would depend on the ShockwaveFlash1 object. You could use a loop from 1 to 13 to cut down on the code, but if the object doesn't allow setting multiple variables in one call, you really don't have any choice.
Do you have an object reference? If so, post a link.
use the split function using : as your find character.
Then, using your array set your textboxes = to the proper indices.
textbox.text = myarray(1) etc.
myarray(0) will hold the text "dispframe" and you should probably drop the leading :
Make sense?
thank's.......... it works now..
but do i really need the connection object in this case ??
The command object needs to know how to connect to your database. So yes, you need either a connection string or a connection object. I can't remember if a command object can use just the connection string or not.
If you just specify the connection string to your cmd object and it works, you can drop the connection object, yes.
How about using javascript?
document.myform.submit;
well, the problem was
i was suppose to write it asRsObj.AddNew RsObj.Fields("fname")="aashish" RsObj.Fields("lname")="n" RsObj.Update
Thank's agrothe , for all the help...............
You're welcome! Your previous use of addnew was suspect to say the least! I'm glad your up and running again.
I would now suggest you start using parametrized queries. The method you are using now is very susceptible to SQL Injection Attacks, which I've experience first hand :) .
The provided link is from 4guysfromrolla website and is an excellent way to update your database (very simple) and provides much greater security.
Cheers.
PS: please mark the thread as solved.
hi
i want to call a sql server stored procedure from my webform.
the stored procedure return parameters.how can i "catch" these parameters and use hem ?
Can you please verify the exact line and highlight it? I havn't see the addnew method used like that before, not saying it won't work, but just to make sure.
Try setting the activeconnection first:
set comm=Server.CreateObject("ADODB.Command")
comm.ActiveConnection=conn
hey thank's..... i tried that too...
but it still gives the same error...
I usually just use:
rstest.Open "tablename", constr, 2, 2
First off, thats C# and not asp. This needs to be in the ASP.NET forum.
Second, if it worked fine and then SQL Connect suddenly stops, check your database not your code.
You probably have an offline SQL database.
You don't give us much to go on here. Do you have a sample page, or a link to the control page?
Typically javascript like so will work:
var txtValue = document.getElementById('idoftextbox').value;
If that's not clear, post some more details.
rstest.Open "test", constr, adOpenDynamic, adLockOptimistic, adCommandTableDirect
aashishn86, you cannot use named parameters without first declaring them.
Try
rstest.Open "test", constr, 2, 3, 512
See here for more numeric values.
Alternatively, you can declare the variables first. like so:
DIM adOpenDynamic, adLockOptimistic, adCommandTableDirect
adOpenDynamic = 2
adLockOptimistic = 3
adCommandTableDirect = 512
Then you can use the named arguments in your open stmt.
<% comobj.CommandType = adCmdTable %>
You don't have adCmdTable defined. ASP doesn't have the built in definitions as does VB. You need to declare it first.
do this before you set the commandtype:
dim adCmdTable
adCmdTable = 2
And visit here for more technical details on the ADODB Command object.
thank u for reply
so i think if site is not on my computer
i just hired space and domain
i must call the company i hired from
and tell them to do as u toldis that no other way because they are with very slow response?!?!?
Most hosts support uploading your own 404.asp and check there first by default. Also, try this page for more information.
I'd use either php or ASP.NET. I've lost any hope in classic ASP over the years . :)
Ok, this isn't really hard. You just need javascript. Of course navigation with JavaScript is almost never a good idea, but here is how.
I'm assuming you have a page called index.asp. index.asp has an iframe called iframe_index.asp. We will link to a page called target.asp with an iframe called target_iframe.asp.
So first your javascript. In the head of your index.asp put:
function nav(target){
[INDENT]window.location='target.asp?param='+target;[/INDENT]
}
Ok, so this javascript function navigates to target.asp with a dynamic param querystring.
On our iframe_index.asp we have the following links:
<a href="javascript:window.top.nav(1)">link1</a>
<a href="javascript:window.top.nav(2)">link2</a>
<a href="javascript:window.top.nav(3)">link3</a>
This code calls the nav function on our index.asp page and redirects us to target.asp
Target.asp uses the following iframe:
<iframe src="target_iframe.asp?param=<%=request.querystring("param")%>"></iframe>
Now, in your target_iframe.asp code, you can do another request.querystring("param") to get the value passed from the iframe_index.asp page and do whatever with it.
DISCLAIMER:
Your iframes must reside on the same domain and server in order for this to work, and you may have some cross-browser issues. I don't recommend using this, but this is how you can do it. You could use sessions and ajax and a few other methods as well.
Cheers.
<%
strConnection = "driver={MySQL ODBC 3.51 Driver};server=localhost;uid=*****;password=*****;database=******"
Set adoDataConn = Server.CreateObject("ADODB.Connection")
adoDataConn.Open strConnection
set batable = adoDataConn.execute("Select * from thedemopage.bands order by viewcount desc limit 10")
do until (batable.eof )
response.write batable("band") & "1<br>"
response.write batable("band") & "2<br>"
response.write batable("band") & "3<br>"
response.write batable("band") & "4<br>"
batable.movenext
loop
%>
I've seen crazy stuff like this before.
Try this query:
set batable = adoDataConn.execute("Select bands.band from bands order by viewcount desc limit 10")
dim bandName
do while not batable.eof
[INDENT]bandName = Cstr(batable("band"))
response.write(bandName)
bandName="" 'to ensure we don't repeat the same value
batable.movenext[/INDENT]
loop
I've seen weird things and only have been able to fix them by casting into a strong type, hence the Cstr type cast. Also, using a local variable first, then displaying the variable has also solved some very weird behavior. I work with asp on a daily basis and I can attest to some VERY strange behavior from ASP.
Is there a specific reason you are using excel as a database? It is not a very scalable method. If your users really need to access the data as an excel spreadsheet you can always give them the option to export smaller sets of data through excel.
I say this having developed applications in access, only to port them to SQL Server later on because access kept crashing with lots of data. Excel is similar, when your application is several years old with lots of data things start breaking.
Think about the whole life cycle of your application. Just some food for thought.
I don't want to bind it with control, other than this any thing:(
Try using disconnected recordset, then apply the recordset to the database after editing.
Dim rst As New ADODB.Recordset
Dim xData(2, 1) As String
Private Sub Form_Load()
xData(0, 0) = "23"
xData(0, 1) = "Michael Jordan"
xData(1, 0) = "24"
xData(1, 1) = "Kobe Bryant"
xData(2, 0) = "33"
xData(2, 1) = "Grant Hill"
With rst
.Fields.Append "idno", adInteger
.Fields.Append "names", adVarChar, 30
.CursorType = adOpenKeyset
.Open
For Index = 0 To UBound(xData)
.AddNew
.Fields("idno") = CInt(xData(Index, 0))
.Fields("names") = xData(Index, 1)
.Update
Next
End With
Set DataGrid1.DataSource = rst
End Sub
This is the exact reason you should be using parameterized SQL so regardless of the date format this would not be an issue.
I could not agree with you more. This is a large code base that I've inherited from a previous developer so most of the code was already written....
For those newbies reading this, parametrized queries / stored procedures should ALWAYS be used, not only for an issue like this, but also for safety reasons, like preventing SQL Injection attacks, etc.
However, I think my only choice after all the research I've done, is to hunt through the code base and change the code. I've tried the set date format and it doesn't always work as desired, and there is only a common connection string, no common connection object....
Which also brings out the point that programs, desktop, web or otherwise which access a database should have a solid database layer through which all SQL is passed... but I digress.
Note: I debated whether this should go in ASP forum or SQL Server forum and I think it belongs here.
Ok, I have a classic ASP web application, a custom intranet, which has been used in 7-8 different installs, 3-4 different servers with no issues.
It uses a SQL Server 2005 database and usually MS Server 2003 and has dates heavily used throughout. Adding various items (news, announcements, careers, events, etc, etc) has never been an issue.
I recently had to install this on SQL Server 2005 Express and Windows 2000 Professional Terminal Server.
For some reason now, a date of 2/1/2009 gets saved as 1/2/2009. I had a look at the date format on the Win2000 box, which was set to dd/mm/yyyy as opposed to the usual mm/dd/yyyy that all the other servers had that this app was installed on. So, I changed the date format to mm/dd/yyyy, rebooted and still the dates get screwed up!
I have verified that all databases, logins, etc have a locale of us_english. The locale hasn't changed from the original SQL Server to the Express edition.
I can fix this by changing the code to
rs("field") = month(date) & "/" & day("date") & "/" & year(date)
But that's a lot of hunting through thousands of lines of code to change. Is there a setting somewhere that I'm missing?
All this means is that you have more up-front planning to do.
You must map the current db structure to a new db structure.
This all takes time of course, and it's your job to communicate to management the extra time involved. To help illustrate your point, make a visual representation of what could happen to the data if this important step is missed.
Given enough time, almost anything can be accomplished. You must make management either give you that time, or decide that the time investment isn't worth the desired outcome of the changes.
The warning should reference a file and line number. Paste that line and surrounding code.
You need a new connection object for each database. If you aren't using classes, just have three recordsets, one for each database.
I'm sure there is a better way to do all of this, but without examining the code it's hard to say the best way.
Sounds like, sir, that you need more than a Forum. A specific item can certainly be addressed, but you really can't expect to learn how to create websites from a forum. May I suggest this link a starting point?
You need the links on your master page. Better to use HTML links like <a href="News.aspx"></a>
as button links can be problematic on mobile devices.
And the best way to achieve this is definitely a recursive function.
As a bit of an afterthought, the loop that "was" working broke once I started adding more menu items.
I came back and implemented this recursive function which required very little modification.
Basically it was System.Collections.Generic.List(Of MenuItem) as opposed to ArrayList.
As this function is only called when the menu is viewed in edit mode and is pulled via AJAX, I'm not too concerned about speed here.
even more +++ rep. Thanks again.
Are you missing a required referenced dll or COM Object?
instead of Eval("f.name")
try
Eval("name")
You shouldn't need the table alias to select fields. If there are duplicate fields, like forumid, use a field alias, like "Select f.forumid as forumID_1, s.forumid as forumID_2.....".
Passing a connection string as a query string is extremely Dangerous...
Passing a value of 1,2,3 or a,b,c which maps to a corresponding connection string is much safer.
Microsoft enterprise library methods take a connection string as a paramter, so pass them all a variable of say strConnectionString,
and on page load do a select case on your query string parameter to set strConnectionString = to the proper connection string.
We use Isqsolutions.com as a reseller at work and find them very reliable. I can safely recommend them as a good choice for ASP and ASP.NET functionality. The also support MS Access, SQL Server and MySQL.
Thanks Fungus1487 (rep++).
I couldn't think of how to structure a recursive loop. I did manage to do the job with a loop structure, but this will definitely come in handy as I migrate from classic asp to asp.net.
I still find myself doing these procedurally instead of OOP, although I never lost any time in dropping inline asp tags... :)
I'm in the process of building a new menu editor for someone at work. I don't know if I've been at this too long or just can't see the forest for the trees....
The database structure's menu items like
id, title, parentid, listorder, link, etc
I'm trying to write this to the asp.net page like so:
<ul>
<li>menu 1</li>
<li>menu 2
<ul>
<li>submenu 1</li>
</ul>
</li>
</ul>
Of course, there may be any number of sub menus, sub submenus, etc...
If there was only 1 nested submenu it would be easy, but what is the best way to handle unlimited submenus and a simple code example of such?
FYI, I'm using VS 2008 targeting .Net 2.0
Ok, first off, is the database connection working? What technology are you using for database connectivity? DAO or ADO?
You build your query by including a text box value in the query string and then send the query via recordset or command object to the database.
So if you have a text box called txtSearch,
dim qry as string
qry = "Select * from sometable WHERE somecolumn LIKE '%" & txtSearch & "%' ORDER BY somecolumn ASC;"
Pass that to your database to receive the information back...
so apparently you can't call a page containing ajax from an ajax script. So I hear. I've also heard about a work around. Something like having all the ajax on the parent page or something.
Does anyone have more information on this?
im having a problem in connecting data access with vb 6 enterprise edition
i dont know how to connect trough ADO
Read the sticky thread on this forum. Here is a link for your reading convenience: http://www.daniweb.com/forums/thread41057.html
I'm leaning in that direction but don't have dreamweaver to test that hypothesis... :)
Can anyone identify which editor/program/ide this ASP generated code may have come from?
Thanks a million if you can!
<html><!-- InstanceBegin template="/Templates/standard.dwt.asp" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>*sniped*</title>
<!-- InstanceEndEditable -->
<link rel="stylesheet" href="Assets/css/layout.css" type="text/css">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
A client has asked me to add a data mining module to a database of customer orders.
I'd appreciate if anyone can point me to an algorithm which can help find trends and order patters from a group of dates.
Does something like this exist? I'm stuck with VBA as my language as the database is access and there is no budget to implement any other types of libraries.
I'd appreciate any help here.
anto_nee, thats exactly right. Problem with Access is it doesn't give you all the properties in the properties drop down, and of course after a while we get lazy and forget all the properties available to us. :)
im thinking of using a richtext box too, but im wondering How i can input the msg, w/ the name of the username
I think what your trying to is this:
Have your users login in order to use the chat app. Store the username in a variable we'll call strUserName. Your richtextbox is called txtMain and your smaller input box called txtMsg for example.
On the button click event, send something like
dim message as string
message = strUserName & ": ----> " & txtMsg.value
functionnametosendmsg(message)
You get the drift anyway right?
I think one text box for message entry and another Listbox would be better to display the message back to back.
debasisdas, I can see how a listbox would be easier to add the messages sent and received, but how would a list box handle long strings? I don't think a listbox can wrap text in a pretty way and a rich text box will allow for fancy formating as opposed to a list box.
Just my 2.146 cents worth (due to the higher canadian dollar :icon_mrgreen:)...
Try binding the datagrid to a database table.
can use flexgrid.rows=flexgrid.rows+1
let me know wht the exact problem do u have
Sorry, forgot to say that this is an Office VBA application, not straight VB. It's a cinche in VB 6, but in Access 2003, the datagrid or flexgrid controls seam to only allow additions and deletions when bound to a table.
I'm trying to add rows without binding the control. I'll try your code anyway in hopes it will work when I get back to my production computer...
Need more info for this one.
Are you talking about a networked chat application, web chat application.
like is using a many textbox good or a Big Nono,
If I understand this right, are you suggesting using a bunch of text boxes??? If so, you should only need two text boxes and a command button.
One large text box to display all the messages sent back and forth, and one small text box to send text. Just think of MSN messenger and you'll get the idea.