Click here to Skip to main content
16,004,944 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Extract frame from Avi Pin
Rupesh Kumar Swami25-Sep-07 0:48
Rupesh Kumar Swami25-Sep-07 0:48 
GeneralRe: Extract frame from Avi Pin
Christian Graus25-Sep-07 1:18
protectorChristian Graus25-Sep-07 1:18 
GeneralRe: Extract frame from Avi Pin
Dave Kreskowiak25-Sep-07 1:39
mveDave Kreskowiak25-Sep-07 1:39 
Questionrow index Pin
md_refay24-Sep-07 22:42
md_refay24-Sep-07 22:42 
AnswerRe: row index Pin
GuyThiebaut24-Sep-07 23:11
professionalGuyThiebaut24-Sep-07 23:11 
AnswerRe: row index Pin
Dave Kreskowiak25-Sep-07 1:38
mveDave Kreskowiak25-Sep-07 1:38 
QuestionCombobox event handling in gridview controls Pin
Pradip Kishore24-Sep-07 22:33
Pradip Kishore24-Sep-07 22:33 
QuestionStrConv("string", vbFromUnicode) in VBScript Pin
gbgift24-Sep-07 22:00
gbgift24-Sep-07 22:00 
Hi,
I need your help!!! I want to use the function StrConv("string", vbFromUnicode) in VBScript.
I found the following code, but the result isn't the same as from VBA, I tested in Excel.
Do anyone has any suggestion?
<br />
Public Function StrConv(stringData,conversion)<br />
    	Dim Stream<br />
    	Dim tmp<br />
    	Set Stream = CreateObject("ADODB.Stream")<br />
    	' Charsets	<br />
    	'	Windows-1252<br />
    	'	Windows-1257<br />
    	'	UTF-8<br />
    	'	UTF-7<br />
    	'	ASCII<br />
    	'	X-ANSI<br />
    	Const UnicodeCharaset = "Windows-1252"<br />
    	Const BinaryCharset = "X-ANSI"<br />
    	Select Case conversion<br />
    		Case vbFromUnicode<br />
    			' Converts a Unicode string to Ascii<br />
    			With Stream<br />
    				.Charset = UnicodeCharaset<br />
    				.Type = 2<br />
    				.Open<br />
    				.WriteText stringData<br />
    				.Position = 0<br />
    				.Charset = BinaryCharset<br />
    				.Type = 1<br />
    				StrConv = MidB(.Read, 1)<br />
    			End With<br />
    			<br />
    		Case vbUnicode<br />
    			' Converts an Ascii string to Unicode<br />
    			Dim Length<br />
    			Dim Buffer<br />
    			<br />
    			If TypeName(stringData) = "Null" Then<br />
    				CStrU = ""<br />
    				Exit Function<br />
    			End If<br />
    			<br />
    			stringData = MidB(stringData, 1)<br />
    		<br />
    			Length = LenB(stringData)<br />
    			Dim Rs<br />
    			Set Rs = Server.CreateObject("ADODB.Recordset")<br />
    			Call Rs.Fields.Append("BinaryData", adLongVarBinary, Length)<br />
    			Rs.Open<br />
    			Rs.AddNew<br />
    			Rs.Fields("BinaryData").AppendChunk(stringData & ChrB(0))<br />
    			Rs.Update<br />
    			Buffer = Rs.Fields("BinaryData").GetChunk(Length)<br />
    			Rs.Close<br />
    			Set Rs = Nothing<br />
    			With Stream<br />
    				.Charset = BinaryCharset<br />
    				.Type = adTypeBinary<br />
    				.Open<br />
    				Call .Write(Buffer)<br />
    				.Position = 0<br />
    				.Type = adTypeText<br />
    				.Charset = UnicodeCharaset<br />
    			End With<br />
    			<br />
    			StrConv = Stream.ReadText(-1)<br />
    	End Select<br />
    Stream.Close<br />
    Set Stream = Nothing<br />
End Function<br />

AnswerRe: StrConv("string", vbFromUnicode) in VBScript Pin
Dave Kreskowiak25-Sep-07 1:34
mveDave Kreskowiak25-Sep-07 1:34 
GeneralRe: StrConv("string", vbFromUnicode) in VBScript Pin
gbgift25-Sep-07 6:27
gbgift25-Sep-07 6:27 
GeneralRe: StrConv("string", vbFromUnicode) in VBScript Pin
Dave Kreskowiak25-Sep-07 12:58
mveDave Kreskowiak25-Sep-07 12:58 
GeneralRe: StrConv("string", vbFromUnicode) in VBScript Pin
gbgift25-Sep-07 22:39
gbgift25-Sep-07 22:39 
GeneralRe: StrConv("string", vbFromUnicode) in VBScript Pin
gbgift4-Oct-07 18:23
gbgift4-Oct-07 18:23 
Questionproblem uploading file Pin
eyes200724-Sep-07 21:13
eyes200724-Sep-07 21:13 
AnswerRe: problem uploading file Pin
Guffa24-Sep-07 21:37
Guffa24-Sep-07 21:37 
GeneralRe: problem uploading file Pin
eyes200724-Sep-07 22:27
eyes200724-Sep-07 22:27 
AnswerRe: problem uploading file Pin
Guffa24-Sep-07 23:38
Guffa24-Sep-07 23:38 
GeneralRe: problem uploading file Pin
eyes200724-Sep-07 23:40
eyes200724-Sep-07 23:40 
QuestionCrystal reports without using database/dataset in vb.net 2005 Pin
vilasvishu24-Sep-07 20:43
vilasvishu24-Sep-07 20:43 
AnswerRe: Crystal reports without using database/dataset in vb.net 2005 Pin
Jens Meyer24-Sep-07 21:30
Jens Meyer24-Sep-07 21:30 
GeneralRe: Crystal reports without using database/dataset in vb.net 2005 Pin
vilasvishu24-Sep-07 21:55
vilasvishu24-Sep-07 21:55 
GeneralRe: Crystal reports without using database/dataset in vb.net 2005 Pin
darkelv24-Sep-07 23:41
darkelv24-Sep-07 23:41 
QuestionPopulating Treeview using DataTable [modified] Pin
klaydze24-Sep-07 18:57
klaydze24-Sep-07 18:57 
AnswerRe: Populating Treeview using DataTable Pin
Dave Kreskowiak25-Sep-07 1:30
mveDave Kreskowiak25-Sep-07 1:30 
GeneralRe: Populating Treeview using DataTable Pin
klaydze25-Sep-07 15:47
klaydze25-Sep-07 15:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.