For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
I am trying to connection using old school VBA.
This works in VBA!
connectionString = "Provider=sqloledb;Data Source=w2012;Initial Catalog=M1_SU;User Id=m1view;Password=connect2m1;"
This works in VB.NET, but says the server does not exist or access is denied...
"Provider=sqloledb;Data Source=sage;Initial Catalog=JobSheet;persist security info=True;Integrated Security=SSPI;"
Why would the server be available in VB.NET but not in VBA?
Here's the complete code. I must be missing something..
Dim connectionString As String
' connectionString = "Provider=sqloledb;Data Source=w2012;Initial Catalog=M1_SU;User Id=m1view;Password=connect2m1;"
connectionString = "Provider=sqloledb;Data Source=sage;Initial Catalog=JobSheet;persist security info=True;Integrated Security=SSPI;"
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim sql As String
sql = "SELECT * From [JobSheet].[dbo].[JobInfo] ORDER BY JobNo "
cn.connectionString = connectionString
[COLOR="#FF0000"]cn.Open ' ERROR'S HERE[/COLOR]
rs.Open sql, cn, adOpenKeyset, adLockReadOnly, adCmdText
Do While Not rs.EOF
Set rs = Nothing
Set cn = Nothing
"Integrated Security" just means to use the credentials of the account running your code. Unless the SQL Server is setup to accept the users Windows accounts as authentication, Integrated Security won't work.
I want rating bar in my outlook. I want rating bar to be populated in outlook email which has subject stating Resolved.
So when user select the rating i need reply email back to me can this be done in outlook.
I know this can be done in microsoft forms but i want in outlook email body only
is taking a (presumably) date object IBSSDR.Item("EventDate") and putting it directly into that function via string concatenation. As usual, put breakpoints in place and inspect the value of .CommandText - this will show you how VB has formatted that date field, using its default (local) formatting, as input to the function.
You will most likely need to use some explicit formatting on the VB side to create a string that Oracle will be able to parse into a date.
But, as Richard always says, don't build your SQL by string concatenation - parameterise it.
Sorry, this always seems to happen after I post but I think I get it now. I'm trying to assign a value to a class. It compiles if i do this:
Private Sub ab(Optional ByVal val As EncryptKey = Nothing)
I was confused by this:
Private Sub ab(Optional ByVal val As String = "")
I don't know how String is defined to be able to accept this but what I'm doing won't work.
Sorry again for the ugly post.
Sorry about the subject line; didn't know how to describe my problem.
Through searching around the internet i've come up with this class to be able to process a string value.
Private _string As String = String.Empty
Public Sub New(ByVal value As String)
' Remove white space
Me._string = value.Trim()
Public Shared Widening Operator CType(ByVal value As String) As EncryptKey
Return New EncryptKey(value)
Public Overrides Function ToString() As String
Public Function Length() As Integer
Public Function IsEmpty() As Boolean
Return (_string.Length = 0)
Public Shared Operator +(ByVal s1 As EncryptKey, ByVal s2 As EncryptKey) As EncryptKey
' Concat and remove white space
Dim temp As String = (s1._string + s2._string).Trim()
Return New EncryptKey(temp)
The class is working except for this case:
Private Sub ab(Optional ByVal val As EncryptKey = "")
' Results in this error for the Optional assigment:
'error BC30060: Conversion from 'String' to 'EncryptKey' cannot occur in a constant expression.
Is there a way to make the class able to accept this assignment as an Optional parameter?
I'm try to fetch the early date value from my event list using MIN but cannot.
Here my code :
<pre>IBSSCMD.CommandText = "SELECT c.NAME AS NAME,c.cardholderid AS cardholderid, c.EMAIL AS EMAIL,A.PRIORITY, MIN(a.eventdate) AS EVENTDATE " & _
"FROM EVENT a , CARDHOLDER c , COMMCHANNEL h" & _
" WHERE(a.CARDID = c.CARDID And a.CARDHOLDERID = c.CARDHOLDERID)" & _
" AND a.COMMCHANNELID = h.COMMCHANNELID AND a.EVENTDATE >= CAST('TODAY' AS DATE) AND a.EVENTMSG = 'Access Granted' " & _
" AND a.PRIORITY IS NULL " & _
"group by c.NAME,c.cardholderid,c.email,A.PRIORITY ;"
Using FBCMD AsNew FbCommand("UPDATE EVENT SET PRIORITY = '1' WHERE CARDHOLDERID = @CARDHOLDERID AND EVENTDATE >= CAST('TODAY' AS DATE) AND EVENTMSG = 'Access Granted'", IBSSCN)
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Although you're using VB.Net, this is not a VB.Net question. Suggest you post under Database & Sysadmin / Database as your issue is with SQL. You should also give us some idea as to what IBSSDR may contain (presumably a datareader from another query), and probably the table definitions and example data too. For instance, will your query (IBSSCMD) be returning a single row or multiple rows?
Hi guys, I just need a little help in retrieving date value from database.
The format of date in date field is "2015-07-03 00:00:00.000"
but when I retrieve it the format automatically change into "07/03/2015 12:00:00"
How can I retrieve the date value as is? I'm using vb.net. Thanks in advance for the help.