|
|
somehow.... I receive an error saying that
Type mismatch
test1.asp, line 11
why is that so???? I had set the Path correct..... table is correct and rs.fields are correct also
<%
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = "Provider=SQLOLEDB;Data Source=SITDB580;....;"
conn.Open DBPath
Set rsDaten=Server.CreateObject("ADODB.Recordset")
strSQL="SELECT * FROM testimonials"
rsDaten.Open strSQL,conn,0,3
nTotalRecs = rsDaten(0)
if nTotalRecs <> 0 then <======line 11
rsDaten.MoveNext
nTotalMax = rsDaten(0)
rsDaten.MoveNext
nTotalMin = rsDaten(0)
end if
rsDaten.Close
Randomize
intChoice = Int((nTotalMax - nTotalMin + 1) * Rnd + nTotalMin)
Set rs=Server.CreateObject("ADODB.Recordset")
strSQL="SELECT * from testimonials where ID="&intChoice &""
rs.Open strSQL,conn
strText=rs.Fields("Text")
strAuthor=rs.Fields("Author")
if not rs.EOF then %>
<%if strAuthor<>"" then %>
<%end if %>
| <%=strText %> | | | - <%=strAuthor%> - | |
<% end if
rs.close
conn.close %>
|
|
|
|
|
It depends on which datatype the field "rsDaten(0)" has.. if its a string or date you can not compare them to 0 ->"nTotalRecs <> 0"
Hmm...
|
|
|
|
|
Ok, maybe I am dumb here but I am trying to detect if my computer is connected to the network.
I spend about 15 minutes going through the docs and I find the System.Windows.Forms.SystemInformation class with Network property. Seems all too easy...
I do the following:
<br />
Dim NetInfo As System.Windows.Forms.SystemInformation<br />
<br />
If NetInfo.Network = True Then<br />
pnlIndicator.BackColor = Color.Green<br />
<br />
Else<br />
pnlIndicator.BackColor = Color.Red<br />
<br />
End If<br />
...and I figure, heay great, I should get a green panel when I have my net cable plugged in and it should go read when my cable gets unplugged (I placed this code into a timer tic event hander).
NOPE. Does not seem to do anything...
Anyone have any darn ideas?
|
|
|
|
|
Mine seems to come up with "true" regardless of the reality as well.
Maybe it means "if there's a network card" or "if there's something plugged into the network card, regardless of where it might go"?
By the way, this function is static, you could just use:
<br />
' Dim removed<br />
If SystemInformation.Network Then<br />
pnlIndicator.BackColor = Color.Green<br />
Else<br />
pnlIndicator.BackColor = Color.Red<br />
End If<br />
Won't solve your problem though.
Paul
|
|
|
|
|
Yeah, looks like it just says 'why yes, you do have a nic'
|
|
|
|
|
Just reply "Well duh, I fitted it, you think I don't know it's there? Now is it connected to anything???"
;)
|
|
|
|
|
Actually, what it means is that you have "Networking" installed. Whether it's DHCP, NetBios, etc it will still show true. If you uninstall your Networking protocols, it should return false. I forget where I saw it but there is a way to detect the Network.
|
|
|
|
|
Well I have to edit an exsisting program that was written in vb6. One of the things that I am doing is adding mysql support to the program, which is in vb. There is no vb api for mysql so I had to write some dlls in c++ to handle mysql for the program. My problem now is that the program cannot find the dlls. Although they are in the same folder, and im sure I am calling them properly. Here is how im calling a function from one of my dlls in vb:
Declare Function writeInfo Lib "RideMySql.dll" (ByRef Param1 As String, ByVal Param2 As Integer, ByVal Param3 As Double, ByVal Param4 As Double, ByRef Param5 As String) As Integer
The corresponding funcion in c++ is prototyped as:
int __declspec(dllexport) CALLBACK writeInfo(char* param1, int param2, double param3, double param4, char* param5);
Thanks in advance.
|
|
|
|
|
Have you included a .def file within the C++ project? This allows VB to talk to the C++ .dll.
Nick Parker
|
|
|
|
|
I can not find anything. Can you send me a code for that please...
ICQ#3953196
rockettr@hotmail.com
_RoCKeT_
|
|
|
|
|
anyone know how to write a messenger WITHOUT using the msn network in .net, maybe with the windows sockets?
thanks!
|
|
|
|
|
Hi
I am also trying to build a messenger in VB.NET. Yes its possible using Winsock. But i am somehow unable to incorporate winsock API in my vb.net application.
|
|
|
|
|
Hi there!
I am learning VB.net, and want to develop my own text editor for program code.
How would I colour certain key words only??
If someone could point me in the right direction I would be most grateful!
Many thanks in advance,
Dan Fowler
|
|
|
|
|
You could easily catch evt the KeyUp event and see if theres somthing typed in that should be colorised..the keywords you could have in an array or something.. simply look up if theres is a match in the array, and then set the color.
Hmm...
|
|
|
|
|
You also need to be able to manage things like cut/copy/paste and the crazy way the poeple can edit (moving cursor around).
All in all it is not really easy, and an clear, fast, easy methid is not trivial.
|
|
|
|
|
If can use its together.I have a question.How to coding for AxCRViewer call report page?
|
|
|
|
|
What's the function to get the local computer name in VB6?
Have a good one!
|
|
|
|
|
There is none, but you can import GetComputerName from the windows API
|
|
|
|
|
You will need this in a module:
Declare Function GetComputerName Lib "kernel32.dll" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Then in your code:
Dim compname As String, retval As Long
compname = Space(255)
retval = GetComputerName(compname, 255)
compname = Left(compname, InStr(compname, vbNullChar) - 1)
HTH
Nick Parker
|
|
|
|
|
I have a code which is less complex
you will have to import import system.net.dns
Sample code is as follows:
Imports System.Net.Dns
Dim shostname As String
shostname = system.Net.DNS.GetHostName()
console.writeline("Your Machine Name = " & shostname)
hope that helps
|
|
|
|
|
This is not possible i VB6..
Hmm...
|
|
|
|
|
ohh you are right thats possible in VB.NET
|
|
|
|
|
Nick parker's code works perfectly!
Thank you all!
/Rulle
|
|
|
|
|
No Problem, you should consider becoming a member.
Nick Parker
|
|
|
|